Hi,
I have been testing the keyboard feature of SDL keyboard looking into the
SDL_keysym structure received from the event queue. I found the following
behaviour unexpected according to the API docs:
-
When unicode is enbaled by SDL_EnableUNICODE() the value of the unicode
field is the same as that of the sym field for unshifted keys. E.g. when
pressing the key with the Swedish letter ‘?’ (the key with a ‘;’ on a US
keyboard mapping) the content of both sym and unicode is 246 (which is a
correct representation of ‘?’ in ISO-8859 encoding). The actual unicode value
of ‘?’ is however a two byte number (in UTF-8). -
When unicode is enbaled by SDL_EnableUNICODE() the value of the unicode
field (which is obviously an ISO-8859 code) correctly translated to the
corresponding uppercase ISO-8859 code (i.e. 214) in case the shift key is
held down. -
When pressing a modifier key only, the mod field will be 0 at the same time
SDL_GetModState() returns the KMOD_* flag. Not until a key to be modified the
mod field get the same value as SDL_GetModState() returns.
I am running an Ubuntu machine using SDL-1.2-11
Is this the intended behaviour and things are just unclear in the docs or is
some of these bugs ?
Or is it a configuration problem of my system? - But I can find no special
requirements and unicode is available in other of my apps, e.g. it is the
default in the console.–
Christer