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

input: prioritize builtin bindings matching longer key sequences #14157

Merged
merged 1 commit into from
May 20, 2024

Conversation

guidocella
Copy link
Contributor

This fixes 2 different bugs:

  • mp.add_key_binding('c', ...) taking priority over the builtin g-c binding.

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

  • mp.add_key_binding('g-c', ...) not taking priority over a c binding defined in input.conf.

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

@guidocella guidocella force-pushed the prioritize-longer-sequences branch from a53377e to 2efac97 Compare May 16, 2024 09:25
@guidocella guidocella changed the title input.c: prioritize builtin bindings matching longer key sequences input: prioritize builtin bindings matching longer key sequences May 16, 2024
Copy link

github-actions bot commented May 16, 2024

Download the artifacts for this pull request:

Windows
macOS

This fixes 2 different bugs:

- mp.add_key_binding('c', ...) taking priority over the builtin g-c
  binding.

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

- mp.add_key_binding('g-c', ...) not taking priority over a c binding
  defined in input.conf.

This happened because is_builtin of bindings added with
mp.add_key_binding is true though they're not actually builtin.
@guidocella guidocella force-pushed the prioritize-longer-sequences branch from 2efac97 to 2bf78d2 Compare May 17, 2024 00:39
@kasper93
Copy link
Contributor

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

@guidocella
Copy link
Contributor Author

Why wouldn't it?

@kasper93
Copy link
Contributor

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

@guidocella
Copy link
Contributor Author

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
Copy link
Contributor

Fair, I guess.

@kasper93 kasper93 merged commit 3f83671 into mpv-player:master May 20, 2024
18 checks passed
@guidocella guidocella deleted the prioritize-longer-sequences branch May 20, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants