SDL2 German keymap issues (MacOS)

Hi,

I’ve had a problem reported by a user of my game that his German
keymap seems to be picked up incorrectly. Hopefully I’m using the
interface correctly - I haven’t had to deal with international key
layouts until now.

His keyboard looks like this:
http://disenchant.net/files/temp/german-kb/Foto.jpeg

However, in my game when he presses the ‘^’ key at the top left of his
keyboard, the event received has scancode 53->SDL_SCANCODE_GRAVE
(correct) and keycode 60->SDLK_LESS (incorrect). When he presses the
’<’ key just to the right of his left shift key, the scancode is
100->SDL_SCANCODE_NONUSBACKSLASH (correct) and the keycode is
94->SDLK_CARET (incorrect).

Here is his keyboard layout according to the OSX keyboard viewer:
http://disenchant.net/files/temp/german-kb/Bildschirmfoto%202013-04-04%20um%2014.36.52.png

Interestingly, if I change the input on my Macbook to German, the
keyboard viewer shows me this, which seems to match the scancode to
keycode conversions the user is describing:
http://disenchant.net/files/temp/german-kb/Screen%20Shot%202013-04-05%20at%209.42.10%20AM.png

I’m using the SDL2.Framework built from current hg.

Any help / guidance appreciated!

Cheers,
Kevin Shanahan.

Does it work correctly with other non-SDL software (e.g. Textedit)?
Because my solar powered Logitech keyboard has the same issue on OSX, also German layout.
Eventually I had to resort to a keyremapper that changed those two keys. Never was able to figure out any other way :frowning:

Yeah, it seems to work okay otherwise - TextEdit is working correctly
he says. QuakeSpasm gets the keys right using SDL 1.2 and the (now
deprecated?) event.key.keysym.unicode.

Doesn’t seem like SDL_StartTextInput is the right thing for what I am
trying to do… just that the keymap SDL2 has found/provided seems to
have two keys swapped.

I might have to try playing with that.On Fri, Apr 05, 2013 at 02:16:36AM -0700, Dominus wrote:

Does it work correctly with other non-SDL software (e.g. Textedit)?
Because my solar powered Logitech keyboard has the same issue on OSX, also German layout.
Eventually I had to resort to a keyremapper that changed those two keys. Never was able to figure out any other way :frowning:


Kevin.

K, I feel it is somehow connected but who knows :wink:
I hope someone has an idea. I think SDL has an input test program. Maybe send him this so you can find out whether it is something you did wrong or SDL messes up

Hello Kevin,

This is not a problem with SDL, this is a problem in your OS X configuration.
I had the exact same problem with the Brazilian Keyboard.

To fix that, go to “System Preferences” > “Keyboard” > “Change Keyboard Type” or something like that (the left bottom corner button)
It will ask you to press the key at the right side of the left shift :slight_smile: Then it will tell you that you have a ISO-type keyboard, just confirm.

Yeah, I know it is not obvious that you need to do that.

Cheers!

Kevin Shanahan wrote:> Hi,

I’ve had a problem reported by a user of my game that his German
keymap seems to be picked up incorrectly. Hopefully I’m using the
interface correctly - I haven’t had to deal with international key
layouts until now.

His keyboard looks like this:
http://disenchant.net/files/temp/german-kb/Foto.jpeg

However, in my game when he presses the ‘^’ key at the top left of his
keyboard, the event received has scancode 53->SDL_SCANCODE_GRAVE
(correct) and keycode 60->SDLK_LESS (incorrect). When he presses the
’<’ key just to the right of his left shift key, the scancode is
100->SDL_SCANCODE_NONUSBACKSLASH (correct) and the keycode is
94->SDLK_CARET (incorrect).

Here is his keyboard layout according to the OSX keyboard viewer:
http://disenchant.net/files/temp/german-kb/Bildschirmfoto%202013-04-04%20um%2014.36.52.png

Interestingly, if I change the input on my Macbook to German, the
keyboard viewer shows me this, which seems to match the scancode to
keycode conversions the user is describing:
http://disenchant.net/files/temp/german-kb/Screen%20Shot%202013-04-05%20at%209.42.10%20AM.png

I’m using the SDL2.Framework built from current hg.

Any help / guidance appreciated!

Cheers,
Kevin Shanahan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rodrigo Cardoso Rocha
@RodrigoRodrigoR - twitter.com/RodrigoRodrigoR
Chibata Creations - chibatacreations.com

Didn’t he just say that other software recognizes the keyboard layout
just fine? If only SDL2 has the issue then it’s a SDL2 problem.

2013/4/5, RodrigoCard :> Hello Kevin,

This is not a problem with SDL, this is a problem in your OS X
configuration.
I had the exact same problem with the Brazilian Keyboard.

To fix that, go to “System Preferences” > “Keyboard” > “Change Keyboard
Type” or something like that (the left bottom corner button)
It will ask you to press the key at the right side of the left shift :slight_smile: Then
it will tell you that you have a ISO-type keyboard, just confirm.

Yeah, I know it is not obvious that you need to do that.

Cheers!

Kevin Shanahan wrote:

Hi,

I’ve had a problem reported by a user of my game that his German
keymap seems to be picked up incorrectly. Hopefully I’m using the
interface correctly - I haven’t had to deal with international key
layouts until now.

His keyboard looks like this:
http://disenchant.net/files/temp/german-kb/Foto.jpeg

However, in my game when he presses the ‘^’ key at the top left of his
keyboard, the event received has scancode 53->SDL_SCANCODE_GRAVE
(correct) and keycode 60->SDLK_LESS (incorrect). When he presses the
’<’ key just to the right of his left shift key, the scancode is
100->SDL_SCANCODE_NONUSBACKSLASH (correct) and the keycode is
94->SDLK_CARET (incorrect).

Here is his keyboard layout according to the OSX keyboard viewer:
http://disenchant.net/files/temp/german-kb/Bildschirmfoto%202013-04-04%20um%2014.36.52.png

Interestingly, if I change the input on my Macbook to German, the
keyboard viewer shows me this, which seems to match the scancode to
keycode conversions the user is describing:
http://disenchant.net/files/temp/german-kb/Screen%20Shot%202013-04-05%20at%209.42.10%20AM.png

I’m using the SDL2.Framework built from current hg.

Any help / guidance appreciated!

Cheers,
Kevin Shanahan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Rodrigo Cardoso Rocha
@RodrigoRodrigoR - twitter.com/RodrigoRodrigoR
Chibata Creations - chibatacreations.com