occivink / mpv-scripts

Various scripts for mpv
The Unlicense
420 stars 38 forks source link

Fix for hotkeys to work with --input-default-bindings=no #1

Closed pavelxdd closed 7 years ago

pavelxdd commented 7 years ago

When input-default-bindings=no is defined in the mpv.conf, the seek-to script doesn't work, because it sets its interactive hotkeys via add_key_binding. This commit changes them to add_forced_key_binding.

I left add_key_binding for the Ctrl+t binding so the user can define it in the input.conf, e.g.: F3 script-binding toggle-seeker

occivink commented 7 years ago

Ah so that's the difference between forced and non-forced, thanks. Would you mind applying those changes to pan.lua? There is a similar binding.

pavelxdd commented 7 years ago

If you ask me, there's no reason to do it for pan.lua, because as I can see it doesn't have interactive hotkeys (those which are added and removed during script executing). They can be safely defined in the input.conf.

PS. oops, sorry - there's actually one such binding. Will change it now.

pavelxdd commented 7 years ago

Done. Can you check if it works for you? I can't get pan.lua to work even with osc disabled.

PS. Ah, it works. Didn't know that I need to hold down the key, not just press it.

occivink commented 7 years ago

Yeah, the default binding mouse_btn0 of pan.lua only works with window-dragging=no, I forgot to mention that in the readme (and/or change the default binding).

Thanks for the PR.