The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Unicode key and AltGr support
Sam Lantinga
Guest

Quote:
The thread about the AltGr got me to test the feature with the uncommon keys
in the French keyboard I'm using. I've tried the AltGr + a few keys
combinations to see the result and I found that a lot of times, SDL didn't
give me back a correct unicode value. Here's the results for the AltGr +
azertyuiop keys :

Quote:
$ ./sdlkeytest-1.2.9
Keyname, (alt gr), Scancode (113), keysym (313), mod (4096), unicode (0)
Keyname, (a), Scancode (24), keysym (97), mod (20480), unicode (230)
Keyname, (z), Scancode (25), keysym (122), mod (20480), unicode (171)
Keyname, (e), Scancode (26), keysym (101), mod (20480), unicode (0)
Keyname, (r), Scancode (27), keysym (114), mod (20480), unicode (182)
Keyname, (t), Scancode (2Cool, keysym (116), mod (20480), unicode (0)
Keyname, (y), Scancode (29), keysym (121), mod (20480), unicode (0)
Keyname, (u), Scancode (30), keysym (117), mod (20480), unicode (0)
Keyname, (i), Scancode (31), keysym (105), mod (20480), unicode (0)
Keyname, (o), Scancode (32), keysym (111), mod (20480), unicode (0)
Keyname, (p), Scancode (33), keysym (112), mod (20480), unicode (254)

Quote:
Here's the expected result :

Quote:
Quote:
Quote:
Quote:
s = u"????????????????????????"
[ord(c) for c in s]
[230, 171, 8364, 182, 359, 8592, 8595, 8594, 339, 254]

By the way, this is fixed on Windows in CVS as of today.

See ya!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment