My personal experience:
- In Linux, it works. I have a GNOME2 desktop with dvorak keyboard layout configured, and SDL programs get the correct keypresses.
- In Windows XP, it does not work. SDL programs behave as if the keyboard was a qwerty keyboard.
- In MacOS X, it does not work. It behaves like a qwerty keyboard.
In your initialization:Let me repeat that this does not work, no matter what he says.
SDL_EnableUNICODE(1);
and then when you get a keyboard event: (From 'man SDL_keysym')
if(!(event.key.keysym.unicode & 0xff80))
ascii = event.key.keysym.unicode;
else
<deal with international characters>;
This method actually *works*, even with weird keyboard layouts like my custom swedish Dvorak variant. :-)
I wrote a conversion routine that maps the SDLKey keysyms from qwerty to dvorak, but this is really no solution. SDL should be made to use the platform-specific keyboard routines so that it correctly uses the configured keyboard layout.