jonniek / mpv-playlistmanager

Mpv lua script to create and manage playlists
The Unlicense
537 stars 42 forks source link

Two buttons to close application #121

Closed jimmy-1000 closed 1 year ago

jimmy-1000 commented 1 year ago

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 _"keycloseplaylist". Is there a way to go back to the old behavior?

tupo2 commented 1 year ago

Should work:

key_showplaylist=F2
key_closeplaylist=ESC F2
jimmy-1000 commented 1 year ago

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 commented 1 year ago

I suspect it's because of this commit d2750f435e81632be14210b8bf3933d52bd9da87

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 commented 1 year ago

I works now, thanks a lot ! 👌