mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.1k stars 2.88k forks source link

input: prioritize builtin bindings matching longer key sequences #14157

Closed guidocella closed 4 months ago

guidocella commented 4 months ago

This fixes 2 different bugs:

This follows up 994a08f5a7 which fixed this within the same input section. This fixes it across different input sections.

This happened because is_builtin of bindings added with mp.add_key_binding is true though they're not actually builtin.

github-actions[bot] commented 4 months ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1511540333.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1511563231.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1516082015.zip)
macOS * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1511538411.zip) * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1511539071.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1511539447.zip)
kasper93 commented 4 months ago

mp.add_key_binding('g', ...) still overrides g-*

guidocella commented 4 months ago

Why wouldn't it?

kasper93 commented 4 months ago

Because I have to put g ignore or some other workaround, even if I have g-* in input.conf.

guidocella commented 4 months ago

This is the documented and expected behavior: "If a or a-b or b are already bound, this will run the first command that matches, and the multi-key command will never be called. Intermediate keys can be remapped to ignore in order to avoid this issue. The maximum number of (non-modifier) keys for combinations is currently 4."

kasper93 commented 4 months ago

Fair, I guess.