Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two buttons to close application #121

Closed
jimmy-1000 opened this issue Jun 5, 2023 · 4 comments
Closed

Two buttons to close application #121

jimmy-1000 opened this issue Jun 5, 2023 · 4 comments

Comments

@jimmy-1000
Copy link

jimmy-1000 commented Jun 5, 2023

Hi, in the previous version I used F2 key to display the playlist and Escape to close this playlist. The good thing is that if I opened with F2 I could close the playlist with F2 again. So I had two keys to close the playlist. But with the latest playlistmanager.lua update I only have one key to close, the one I use in "key_closeplaylist". Is there a way to go back to the old behavior?

@jimmy-1000 jimmy-1000 changed the title Wwo buttons to close application Jun 5, 2023
@tupo2
Copy link

tupo2 commented Jul 13, 2023

Should work:

key_showplaylist=F2
key_closeplaylist=ESC F2
@jimmy-1000
Copy link
Author

Should work:

key_showplaylist=F2
key_closeplaylist=ESC F2

Sadly not. That and similar the system take the first key and ignore the second.

@jonniek
Copy link
Owner

jonniek commented Jul 15, 2023

I suspect it's because of this commit d2750f4

Should work:

key_showplaylist=F2
key_closeplaylist=ESC F2

Sadly not. That and similar the system take the first key and ignore the second.

This should indeed work. I tested adding some logging and this is how it works for me:

# open mpv
[playlistmanager] BIND KEYS F2 showplaylist
# press F2
[playlistmanager] SHOWING PLAYLIST
[playlistmanager] BIND KEYS FORCED ESC F2 closeplaylist
# press F2
[playlistmanager] CLOSING PLAYLIST
[playlistmanager] UNBINDING ESC F2 closeplaylist

So the closeplaylist keybind is supposed to override the openplaylist keybinding. Are you using the playlistmanager.lua, playlistmanager.conf or input.conf file to set the keybinds?

To me it sounds like your open and close functions would be somehow bound at the same time, which would cause the playlist to quickly render and then close immediately. Unfortunately I don't really have good debug messages in place, that would help debugging your situation.

I made a temporary branch with the debug prints https://raw.githubusercontent.com/jonniek/mpv-playlistmanager/debug-prints/playlistmanager.lua

Could you try reproducing my above debug messages:

  1. use above lua as script
  2. open any file
  3. press F2
  4. press F2 again
  5. close mpv

If the above script works for you, then could you let me know your config, as there might be some other unrelated config value causing the bug.

@jimmy-1000
Copy link
Author

I works now, thanks a lot ! 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants