Re: [AD] keyboard recalcitrant under X

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


On Sun, 2003-03-09 at 20:57, Julien Cugniere wrote:

> Ok, thanks a lot, I managed to get it working using this. Maybe xkeymap.txt 
> should be part of the main doc ? I can have a try at a patch for this, if no 
> one else wants to do it.

Don't know, I think mentioning it in the Unix-specific section would be
enough.

> But it's really a shame that such a hack is needed :( When you distribute a 
> game, you can't very well ask the player to create a mapping like that... how 
> do other libraries manage ? Do they use the native keycodes of the platform 
> the program is compiled onto ?
> 

A mapping from the X-codes to something else is always needed, else
programs would be quite non-portable. Allegro just does a bad job at
mapping X-keycodes to Allegro-keycodes. I.e., what you do manually in
xkeymap, could be automated to some extent, at least for every key where
unicode characters are produced. The procedure would be like this: Go
through all possible X-keycodes, look which unicode character they
produce, and then look through all possible Allegro keys for one which
produces a matching unicode character.

The reason nobody liked to implement this, it get's a bit more
complicated, because you also have to detect the modifier keys, for
which I found no way in the X libs. And Allegro4 doesn't auto-detect the
keyboard language, so the user would still have to specify which
language the keyboard is in.

I really hope A5 has a better approach, but I didn't try the snapshot
yet..

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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