Key symbol missing: "Multi key" (X11)

Hello,

I have found some X11 installations under Linux and Solaris
where the right ‘Control’ modifier key (Linux) or one of the
modifier keys on the Sun keyboard (Solaris) was mapped to the
X11 key symbol (KeySym) ‘XK_Multi_key’ (0xFF20) – unfortunately,
this key symbol does not exists in SDL. (It generates an event,
but then ‘SDL_GetModState()’ returns zero.)

Normally this modifier key is mapped to SDLK_RCTRL in SDL, but
unfortunately not in these cases…

It should be quite easy to add a new key symbol, e.g. ‘SDLK_MULTI’,
to the ‘SDLKey’ enumeration in “SDL_keysym.h” and add a line

    MISC_keymap[XK_Multi_key & 0xFF] = SDLK_MULTI;

to ‘X11_InitKeymap()’ in “src/video/x11/SDL_x11events.c”.

This shouldn’t hurt on the other SDL platforms (where this key
probably won’t exist), but helps a lot on X11 when the X server
returns ‘XK_Multi_key’ on the right ‘Ctrl’ key.

Has anyone else missed this key in SDL, too?

Best regards,
Holger–
holger.schemel at mediaways.net ++49 +5241 80
1438

I have found some X11 installations under Linux and Solaris
where the right ‘Control’ modifier key (Linux) or one of the
modifier keys on the Sun keyboard (Solaris) was mapped to the
X11 key symbol (KeySym) ‘XK_Multi_key’ (0xFF20) – unfortunately,
this key symbol does not exists in SDL. (It generates an event,
but then ‘SDL_GetModState()’ returns zero.)

The Multi_Key is that commonly labeled Compose, and its semantics is
generally the following: Press (and release) Compose and two other
keys in sequence, and the generated symbol is somehow the composition
of the two last keys. Keyboards often have a LED that lights up during
the process. It’s a bit related to dead keys for accentuated
characters in how it works, and very useful for generating characters
you can’t get at in any other way.

I have found some X11 installations under Linux and Solaris
where the right ‘Control’ modifier key (Linux) or one of the
modifier keys on the Sun keyboard (Solaris) was mapped to the
X11 key symbol (KeySym) ‘XK_Multi_key’ (0xFF20) – unfortunately,
this key symbol does not exists in SDL. (It generates an event,
but then ‘SDL_GetModState()’ returns zero.)

The Multi_Key is that commonly labeled Compose, and its semantics is
generally the following: Press (and release) Compose and two other
keys in sequence, and the generated symbol is somehow the composition
of the two last keys. Keyboards often have a LED that lights up during
the process. It’s a bit related to dead keys for accentuated
characters in how it works, and very useful for generating characters
you can’t get at in any other way.

This is generally hidden by the X server keycode translation, so what
would the proper way of handling this be? SDL generally relies on the
OS to provide translated characters and doesn’t do any modifier processing
internally.

-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This is generally hidden by the X server keycode translation, so what
would the proper way of handling this be? SDL generally relies on the
OS to provide translated characters and doesn’t do any modifier processing
internally.

Just as other non-character-generating keys are handled, like shift keys
or dead accents: generate keycodes but don’t map them to character codes

I have found some X11 installations under Linux and Solaris
where the right ‘Control’ modifier key (Linux) or one of the
modifier keys on the Sun keyboard (Solaris) was mapped to the
X11 key symbol (KeySym) ‘XK_Multi_key’ (0xFF20) – unfortunately,
this key symbol does not exists in SDL. (It generates an event,
but then ‘SDL_GetModState()’ returns zero.)

Normally this modifier key is mapped to SDLK_RCTRL in SDL, but
unfortunately not in these cases…

Okay, I just added support for it, as the new keysym SDLK_COMPOSE.
Check out the latest CVS snapshot:
http://www.libsdl.org/cvs.html

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software