Re: [AD] linux keyboard mapping?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, 2002-10-17 at 08:37, Eric Botcazou wrote:
> > I can't look it up right now, but this is how I remember it.  If the user
> > presses the button with a "S" drawn on it, the X server will send a
> > keycode to the application, and from that keycode the application can look
> > up the corresponding keysym (XK_s or something like that).  But, AFAIK,
> > the app can't find out whether or not that keycode was caused by the
> > button two positions to the right of the Caps Lock button.
> 
> Yes, the internal mapping is server-dependent. We would have to maintain
> sort of a database of server mappings. However, given that the vast majority
> of users probably uses XFree86 on PCs, doing so could be worthwhile.

To me it seems, the mentioned xkeymap program by Michael Bukin
automatically (or maybe with a setup utility where I have to press each
key once) can create those server mappings, so we'd just have to include
the code into Allegro (or the setup program) - and the problem would be
fixed.

I looked shortly at Allegro's code, and what I'd have to do to get my
keyboard working right now is, manually create am inverse mapping from
my keyboard's XK-codes onto the XK-codes of a standard US PC keyboard,
which is the only type of keyboard Allegro seems to understand. (At
least, the X keyboard driver obviously converts X keysyms into
DOS-PC-scancodes, which are double-looked up to later get Allegro
keycodes. Ultimatively, the DOS-PC-scancode layer would be removed out
of X-Allegro, but that's probably for Allegro 5.)

> The other solution is to provide hooks in the internal keyboard handling
> code of Allegro in order to bypass/customize it.
> 

If I understand right, that's what I'd like most - just bypass the
keyboard mapping and directly return the ASCII/unicode characters to the
user. But I guess I should read the A5 list on that topic first.. :)

--
Elias Pschernig



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/