0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00
mpv/DOCS/interface-changes/keybind-cancel.txt
nanahi eeb8e6e451 defaults.lua: handle canceled key bindings
There is a subtle behavior difference for built-in/input.conf key bindings
and key bindings registered by scripts: when a key binding is canceled
(e.g. a mouse button is bound to a command, is pressed down, and then
another key is pressed which is bound to another command), the command is
not invoked if the binding is built-in/input.conf, but is invoked if it's
registered by scripts, because it's handled with a different mechanism,
which gives no way for scripts to detect this.

Fix this by using the newly available canceled flag to detect this.
If a key binding is canceled, the callback is now not invoked unless
the key binding is registered with the complex option. In this situation,
the callback is invoked with the canceled state available so that scripts
can detect and handle this situation.
2024-06-06 23:38:39 +03:00

3 lines
234 B
Plaintext

change `mp.add_key_binding` so that by default, the callback is not invoked if the event is canceled; clients should now use the `complex` option to detect this situation
add `canceled` entry to `mp.add_key_binding` callback argument