bmx-ng / sdl.mod

SDL backend for BlitzMax
7 stars 6 forks source link

NG: Key_Z and Key_Y switched on German keyboards #16

Closed GWRon closed 5 years ago

GWRon commented 5 years ago

I just found out that my vanilla build reacts correct to keycodes for KEY_Z and KEY_Y (they are switched on German - and other - keyboard layouts, QWERTZ not QWERTY). But on an NG build these two keys are switched.

GWRon commented 5 years ago

Think one of the reasons might be SDL.mod/sdlsystem.mod

It uses "SDLSCANCODE*" - which is the physical representation of keys, not the "mapped" one whic changes depending on a users keyboard layout.

Edit: https://gist.github.com/stuartpb/804078/18faabdc0310d864bd38a39ae8d9bdf7794572cd

GWRon commented 5 years ago

Reading "glue.c" of sdlsystem.mod it seems as if this is an sdl.mod issue. So feel free to close this here and reopen a new one for sdl.mod once you got aware of this issue.

woollybah commented 5 years ago

So I should change to using keycodes instead then?

GWRon commented 5 years ago

Seems my old reply was added to another issue as you moved this one ;-)

Did you check the "gist" I linked above? It explains the differences. Instead of "SDLSCANCODE" one should use "SDLK_" as it contains the mapped codes.

GWRon commented 5 years ago

or even simpler than the GIST: https://wiki.libsdl.org/CategoryKeyboard https://wiki.libsdl.org/SDL_Keycode

Edit: the SDL_Keysym object/type/struct contains both - SDL_Scancode and SDL_Keycode

GWRon commented 5 years ago

Just want to confirm that it works now as expected.

woollybah commented 5 years ago

Thanks :-)