-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feature request: For SDL2, in keycode mode, allow remapping of modifier keys #28
Comments
I don't understand the intention of excluding modifier keys from customizing keymaps. Please test: |
I tested this branch in Mac OS X 10.12 and Linux, working around #29, and the keyboard remapping works fine. |
Merged to the master. |
I'm having a problem related to #28, but I'm not sure if it should be under that issue or a new one. So I'm doing both. Feel free to delete whichever one you feel is best. My system config is this:
HARDWARE:
As you can see above, I'm using a keyboard made for Macs on my Linux system. I'm trying to get my SheepShaver Mac to use the correct command and option keys on my Mac keyboard. Other builds I've been running previously (from vasi, as posted on the e-maculation forums) have swapped the command and option keys and also would only respond to the left command and option keys, ignoring the right-hand command and option keys. I ran across issue #28 while searching for a solution, and downloaded a snapshot to see if your SheepShaver was any better. I looked at the code in video_sdl2.cpp and found the places where the keycodes were being swapped unless the Since swapping those keys isn't appropriate for the Mac keyboard I'm using, I commented out the This mostly worked! But there is an odd bug that I cant' figure out so far: when I press a command-key combination it seems to be sending the regular keypress first and then immediately follows it with the correct command-key combo that I pressed. For Example:
The order that these key events happens in can be verified like this:
Like i said earlier, I don't know if this should be under issue #28 or in its own issue. Also, I'm not sure whether it should be a bug or a feature request to not swap the command and option keys when a Mac keyboard is being used regardless of whether the system itself is a Mac. |
In SDL2 keyboard handling, for the case where
keycodes
is enabled, host modifier keys are specifically excluded from the cases that provided mapping:macemu/BasiliskII/src/SDL/video_sdl2.cpp
Line 2213 in c23967b
macemu/BasiliskII/src/SDL/video_sdl2.cpp
Line 2244 in c23967b
This prevents re-mapping of modifier keys. This is inconvenient.
This was put in for SDL in b6e1e6e , at the same time as some SDL Mac OS X keyboard fixes, so perhaps the modifier change is for SDL on Mac OS X also? Is it necessary to avoid a problem of some kind?
Is this also true for SDL2?
If the exception for modifiers is not needed for SDL2 it could simply be removed.
Alternatively, if it is necessary to handle modifiers as keysyms for whatever reason, another approach would be to add logic that infers the keysym remappings for modifiers from the keycodes table and applies them on the keysyms side.
The text was updated successfully, but these errors were encountered: