[SDL] SDL and language dependent keys

Mattias Engdegård f91-men at nada.kth.se
Wed Aug 8 01:48:01 PDT 2001


"Ryan C. Gordon" <icculus at clutteredmind.org> wrote:
>They should come up as SDL_WORLD_nn. Take a look at
>SDL12/include/SDL_keysym.h ... You'll have to test and see which one it
>is.

The SDL_WORLD_nn definitions should go away since they serve no purpose at
all and are confusing at best. I suggest nobody should use them.

The current principle of keysym number assignment is:

1. For keys whose printed symbols correspond directly to an ASCII code,
   use that ASCII code (8, 9, 13, 27, 32-127)
2. For some of the other keys, fixed numbers > 255 are used,
   with corresponding definitions in SDL_keysym.h
3. For the remaining keys, leftover numbers < 255 are used in an unspecified
   way.
4. As an exception to 3., sometimes key numbers are added to the list in
   SDL_keysym.h in an ad hoc way.

No, this is not a great solution, but it's how it works right now.

It's not as bad as it sounds since the SDLK_ constants are rarely needed
except for a) special function keys and modifiers (which mostly _are_ defined),
and b) for the initial values of keyboard bindings. But since most
games that use the keyboard at all support user-controlled key rebinding,
the programmer can conservatively use keys that appear in the list and
let the user bind to his more exotic keys





More information about the SDL mailing list