libsdl1.2: problem looking up keysyms under X11
Sam Hocevar
sam at zoy.org
Sat May 13 22:13:53 UTC 2006
On Thu, Mar 17, 2005, Jochen Voss wrote:
> the SDL-library does not properly lookup keysyms under X11. Each key
> has a list of four keysyms assigned to it, which are interpreted as
> "group 1 without shift", "group 1 with shift", "group 2 without
> shift", and "group 2 with shift". The SDL library only uses the first
> element of this array. This makes it impossible to use keysyms from
> group 2 (i.e. keysyms accessed using the altgr modifier).
>
> The problem is in the file src/video/x11/SDL_x11events.c, line 621:
>
> xsym = XKeycodeToKeysym(display, kc, 0);
>
> The "0" is the index into the above mentioned list and thus we get
> always the first keysym.
I applied your patch but I am now reverting it. Keysyms are supposed
to represent physycal keys, so that SDL_GetKeyState() works. If you need
the AltGr-combined keys, you should probably have a look at the .unicode
member of the structure. Similarly, any program that relies on the user
pressing the SDLK_2 key is broken, because on many keyboards there is no
such thing as the "2" key.
Let me know what you think.
--
Sam.
More information about the Pkg-sdl-maintainers
mailing list