[AD] From AL: Dead keys in allegro/mandrake |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Thanks Julien and Elias for explanations.
(I thought that `_xwin_keydrv_handler' was the callback from X (because:
/*Keyboard "interrupt" handler*/), and I still don't understand which
magic forces that calls it, but it's obvious that
`_xwin_private_process_event' is lower down, it gets all key presses)
If I understand it right there are two mappings, one from keycode to
symbolcode and another from symbolcode to scancode. These are used to
set up a direct mapping from keycode to scancode, i.e.
key_to_scan[i] = sym_to_scan[key_to_sym[i]]
This is done in `_xwin_private_init_keyboard_tables' where available
keycodes are fetched from X as well as their mapping to symbolcodes.
However the mapping from symbolcodes to scancodes are set up as a static
mapping (exept from the xkeymap overloading capability). For different
language settings in X, there might be conflicts between some symbolkeys
(they need to map to different scancodes defpending on the setting), is
that right?
As you mentioned, there are some missing entries in the table. The
attached patch fixes some of the problems with the US keyboard,
specially the alt-gr key works. Two keys are still dead, because I don't
know thier Allegro names (which is needed to generate codes from
xkeymap, which in turn is needed to know what to put in the table). I
also added some entries for Swedish keybord. I would be fine if at least
people with French and German keybords could verify that nothing has
gone worse.
Someone that knows if it is likely to work in most cases if distributing
the xkeymap definitions with an app.? (across various Linux distros)
--
Christer Sandberg <csg01@xxxxxxxxxx>
--- xwin.c 2004-04-27 13:53:05.000000000 +0200
+++ xwin-modified.c 2004-06-04 21:46:03.370399840 +0200
@@ -2590,7 +2590,7 @@
{ XK_8, 0x09 },
{ XK_9, 0x0A },
{ XK_0, 0x0B },
- { XK_minus, 0x0C },
+ { XK_minus, 0x35 },
{ XK_equal, 0x0D },
{ XK_backslash, 0x2B },
{ XK_BackSpace, 0x0E },
@@ -2675,6 +2675,14 @@
{ XK_KP_Insert, 0x52 },
{ XK_KP_Delete, 0x53 },
+ { XK_plus, 0x0C },
+ { XK_aring, 0x1A },
+ { XK_odiaeresis, 0x27 },
+ { XK_adiaeresis, 0x28 },
+ { XK_section, 0x29 },
+ { XK_Mode_switch, 0xB8 },
+ { XK_less, 0xD6 },
+
/* Some X servers return different keycodes depending
upon whether NumLock is turned on. */
{ XK_KP_1, 0x4F },