-
Notifications
You must be signed in to change notification settings - Fork 170
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
Keyboard layout breaks hotkeys #398
Comments
Do you know an open source application not having this problem? If so, I can look in the source code for a solution, or maybe it's currently not possible doing something better. |
To be clear if it launched first with English active layout, it works just fine with Russian layout too. |
I looked and didn't find any special keyboard code in Files and Notepads, both are likely UWP based, which could make a difference. However, I switched the keyboard language using ALT+SHIFT and also using WIN+SPACE while mpv.net is active, and mpv.net reacted to the change, so here it is working correctly, this is Windows 11. Unless another developer helps, I really don't know what to do. Possibly related: |
Once again it's not about switching keyboard language, it' about program being launched with specific keyboard language: The problem I described:
What is working:
Something breaking at program start and I'm not sure why. Is it have to be this ways because of some Win32 inconveniences? |
I can now reproduce it, but haven't yet found a solution. |
Difficult issue it seems, it might take a while until I find a solution. |
Unfortunately, I cannot find the reason, so I have to ask mpv developers. |
If it helps when I launch mpvnet from command line, I see
when I press ` ('ё' in Russian layout) so its like getting stuck with Russian layout if launched with it. |
I've already checked that, mpv is not having this issue. |
I made a support request on the mpv tracker, waiting for help now. |
It's finally making progress. |
It will be fixed in the next build. |
Find a hotfix to download here: |
Seems working. Though it would be nice to have ability to handle hotkeys (as English layout) regardless of current layout, if it even possible to implement. |
I don't know if there is an easy way, only changing the layout, for instance with ActivateKeyboardLayout. There is a property input-bindings which can get you all bindings in JSON format. That could be analyzed and used to generate additional bindings with non-western characters, for that there is an input command keybind. Relevant code is here: https://github.com/stax76/mpv.net/blob/master/src/WPF/LearnWindow.xaml.cs Another way might be installing a keyboard hook, see Win32 keyboard hooks. |
I can try if it's possible to enforce a particular layout, if yes provide an option. |
I tried the Win32 function ActivateKeyboardLayout, and it changed the system layout and not only the process layout, that means there might not be an easy way to achieve your goal, it can only be done with a lot of work I guess. Maybe ask somewhere like stackoverflow if you want to be sure, maybe somebody with experience in this area finds the question and answers it. |
version 5.7.0.0 from MS Store
Windows 10 21H1
If mpv is launched while non-English keyboard layout is active (Russian layout in my case) it will not respond to keys (like a, z, ~), even after switching to English layout. Only restart helps.
The text was updated successfully, but these errors were encountered: