Repository navigation
Conversation
soredake
force-pushed
the
layout-independent-keybindings
branch
from
November 11, 2026 15:18
8361e0e to
4c397ef
Compare
soredake
marked this pull request as draft
November 12, 2026 18:57
On Windows, keyboard input is translated with ToUnicode according to the currently active keyboard layout, so keybindings only work when the layout produces the bound characters (e.g. bindings stop working when a non-latin layout is active). This fixes the Windows part of mpv-player#351. Add an option (disabled by default) that translates virtual keys as if the US English layout was active by using ToUnicodeEx with the HKL of the US English layout. Virtual key codes already follow the letters engraved on the physical keys, so this makes bindings match the physical keys regardless of the active layout, similar to how Ctrl+C / Ctrl+V behave in most GUI software. Injected unicode input (WM_CHAR/WM_UNICHAR) is unaffected and keeps working as before. If the US English layout cannot be loaded, input falls back to translation with the active layout and a warning is logged once. AltGr combinations follow the US layout as well, which is documented along with the option.
soredake
force-pushed
the
layout-independent-keybindings
branch
from
November 13, 2026 07:00
4c397ef to
b68ccb0
Compare
soredake
marked this pull request as ready for review
November 13, 2026 07:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, key input is translated with
ToUnicodeaccording to the currently active keyboard layout, so bindings only work while the active layout produces the bound characters. With a non-latin layout active, letter bindings stop working and users have to switch layouts just to control the player (#351).Add
--input-layout-independent(disabled by default). When enabled, virtual keys are translated withToUnicodeExusing the US English layout HKL, so bindings follow the letters engraved on the physical keys regardless of the active layout, similar to how Ctrl+C/Ctrl+V behave in most GUI software.Notes:
Implements the Windows part of #351.
Tested on Windows 11 x64 with Russian and Ukrainian layouts active, both option states, via
--input-testwith a CI-built binary of this commit.Disclosure: this change and pull request were prepared with the assistance of the ZCode agent running the GLM-5.3-Flash model, at the direction of the human author.