1.3 proposals (was: Re: [SDL] LoadLibrary analogous function?)
opichals at seznam.cz
Thu Aug 30 01:28:00 PDT 2001
On Wed, 29 Aug 2001, John R. Hall wrote:
> > I think Xes does have "multikeyboard" scancodes. I think there should be
> > as many SDLK_ s as there exists particular keys on all keyboards. The
> > scancodes conversion should do the OS, doesn't it? Another conversion does
> > Xes.
> > BTW: There was a thread a month ago where someone agreed with this
> > proposal.
> For what it's worth: There are several layers of keyboard code mapping.
> kscan codes - physical scancodes reported by the keyboard to the
> controller over the serial link. You never see these, but if you really
> wanted to, you could get them if you knew where to look.
> scancodes - somewhat system-dependent multi-byte codes reported by the
> hardware to the OS.
> keycodes - 8-bit codes reported by the kernel in raw or mediumraw modes.
> High bit is press/release, lower 7 bits are the key number. This is where
> keymaps come in.
> Note that the X Window System IGNORES keycodes entirely and performs
> its own scancode processing. This is why console keymaps don't have
> any effect in X. There are also 8 bits of modifier flags, to handle
> shift, alt, control, and various international keys.
This is what we should handle independently. The problem I see with SDL is
that if I use setxkbmap in X Windows then I got differrent SDLK_ for the
same key as before using it. This implies that e.g. car simulator control
doesn't have the control keys set correctly...
The character pressed is another thing than SDLK_ I think. The SDLKs
should become scancode alalogy (but driver/OS/platform independent). There
should be another API function returning the character typed, which should
be converted according to e.g. xkbmap or any other keyborad layout
> If I recall correctly, the SDLK_ constants map to keycodes. SDL queries
> the kernel for the meaning of keycodes to handle internationalization.
Well, I think there shoudn't be the internacionalization feature for SDLK_
> Chapter 8 of Programming Linux Games discusses this whole mess.
Good to know.
More information about the SDL