-
Notifications
You must be signed in to change notification settings - Fork 425
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
Use SDL_Keycodes instead of SDL_Scancodes to map the keys #5774
base: master
Are you sure you want to change the base?
Conversation
Please read the description of #3950 and check that this PR does not regress what that one was intended to fix. |
From what I just tested, there doesn't seem to be any regression from #3950. (I didn't test on German QWERTZ) I compared the logs in the console and it produces the same result between my Pull Request and the master. |
I just tested myself, and while yes, text input does seem to be working correctly still (likely because we're now exclusively using IME code paths from SDL for that), there is this part of the description of the aforementioned PR:
This is still the case: osu-framework/osu.Framework/Platform/SDL2Window_Input.cs Lines 442 to 446 in 53d6da4
As such, if you perform the following steps:
you should see that the keys highlighted in orange on the image above can no longer be assigned to any keybinding. I've tested this (mostly, because I don't physically have some of these keys) on my machine just now. |
Okay, I was able to reproduce the problem on osu! I'll look for a way to fix it. |
Replace the switch case with a HashSet that contains InputKey, Key, SDL_Keycode and SDL_Scancode. A key is assigned to an SDL_Keycode and if the key is UNKNOWN then it is assigned to an SDL_Scancode as before. This will allow the shortcuts to be used normally on non-US keyboards.
7d5b3b4
to
4469f38
Compare
It's ok, it took me a while but I finally found a satisfying solution that works perfectly (according to the tests I did). In addition to my previous tests, I tested with the Windows virtual keyboard to test different keyboards: US, French, Genman, Japanese and Arabic. I also checked that the NumLock still works. |
Sorry, I should have stopped you earlier, but this is not the correct direction. I already have a pull in the works that does this in a different way. There needs to be an But for other actions, like undo, people expect them to use keycodes like you did here. Both cases need to be supported at once, so this complicates things. |
This my first Pull Request, so tell me if something is missing or doesn't fit the contributing guidelines.
I submit a patch that fix the issue #5767 that I reported last week.
I changed the mapping to make the shortcut keys, like
Ctrl + Z
, also works on other type of keyboard than US.I added a small unit test to check that
Key.NonUSBackSlash
still working.I tested with Visual-Test that all keys is working correctly.
⚠️ I only tested on Windows10 with a french keyboard with AZERTY and QWERTY layout.
It would be safer to have a few people testing on Linux, Mac or other keyboards to make sure everything is working properly and that there is no regression.
Hoping that this PR will help.