[SDL] SDL and language dependent keys

Standa Opichal opichals at seznam.cz
Wed Aug 8 10:35:59 PDT 2001

> >But for this emulator I need to transform all (O.K. the most) keys to the
> >keys of the emulatetd system. This is also necessary for the german umlauts or
> >special french keys....
> That is a problem. Unfortunately the keys that don't have explicit SDLK_
> constants have no fixed value (they may vary between drivers).

You've got the point!

> >Maybe I use hardware dependent scancode in the SDL_keysym structure. Are
> >this hardware dependent scancodes for all Linux drivers (X, framebuffer, ...)
> >the same? Are this scancodes the X scancodes?
> No, they are not (necessarily) the same. For instance, the X11 driver uses
> X keycodes for "scancode", and these depend on keyboard hardware and X server.
> One solution for this mess would be to give each possible key a different
> keysym number (like X11 keysyms), with a different SDLK_ define for each.
> Then we add API functions to map between scancodes and keysyms, and use
> scancodes in SDL keyboard events. This gives us a compact and nice
> set of scancodes for internal use, and a wide range of keysyms.

Well, my understanding of SDLK_ constants is that they should be
equivalent to SCANCODE_ ones with the thing that they must not be
HW/OS/Driver dependent.
In my opinion we should have as many SDLK_ constants as many real keyboard
keys exists over all keyboards on all computer types in the world.

I'm also writting an emulator that needs this kind of thing.

BTW: I can help with the development if someone allows me to do so.

best regards


More information about the SDL mailing list