Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifier keys on Mac OS X do not have scancodes
This actually fixes three related issues: - Modifier keys on OS X should have "unknown" scancodes - Unknown scancodes on OS X should have the value 0, even though that conflicts with the scancode for "a" - RGUI and RSHIFT should have scancodes on non-OSX platforms. SDL 1.2's Quartz backend, used on Mac OS X, always gives modifier keys a scancode of 0, even though OS X actually does have a scancode number for them. This can be seen (both for < OS X 10.3, where left and right modifiers could not be distinguished, and for newer versions where they can) in the implementation here: https://github.com/libsdl-org/SDL-1.2/blob/02c0253780c8a36569b271500a37591ab80e923d/src/video/quartz/SDL_QuartzEvents.m#L475 Applications such as DOSBox rely heavily on this behaviour, and the keys will not function in the default "usescancodes=true" mode if a scancode other than 0 is returned for the right-hand-side modifier keys. This can be seen in sdl12-compat GitHub issue #84, where the issue was analysed: #84 (comment)
- Loading branch information