[AD] X keyboard problem with ALT

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


Hello,

I tried to try my game in X11 (I usually code in fbcon), and could not get some
keystrokes with alt in them. I investigated and and found a problem with
detecting ALT:
It seems that the left ALT key is detected as being a windows key (which hurts
me a lot because it is not ;)). It toggles key_shifts bit 3 (8) instead of
bit 2 (4)).
I have added some traces to two X11 Allegro routines, the sample code of
which follows. I stopped tracing when I reached the part when a lookup is
done with the results of a keysym X11 call, which I don't know if it sends
back a correct result.
KeyPress and KeyRelease events are received OK.
I have a 2.2.10 kernel, recompiled but not modified SuSE distro.
XFree/86 3.3.4-9 configured for french mapping, and using FVWM2.
AZERTY keyboard with those strange new useless keys with winlogo on them,
configured as QWERTY in the console, and AZERTY in X11.
When I type alt-X in an xterm, I get a scandinavian letter that looks like
a 0 (a O with a slash in it, don't know how to call it).
When I type alt-0 in an xterm, I get a 'a' with an accent, which is the same
that 0 without alt, which is normal (for an AZERTY kbd).
Those alt-X and alt-0 were the two keys I tried and which did not react like
they should have.


-------------------- _xwin_private_process_event ------------------
static void _xwin_private_process_event(XEvent *event)
{
   int kcode, scode, dx, dy, dz = 0;
   static int mouse_buttons = 0;
   static int mouse_savedx = 0;
   static int mouse_savedy = 0;
   static int mouse_warp_now = 0;
   static int mouse_was_warped = 0;

printf("Event!\n");
   switch (event->type) {
      case KeyPress:
printf("KeyPress: code %d\n",event->xkey.keycode);
	 /* Key pressed.  */
	 kcode = event->xkey.keycode;
	 if ((kcode >= 0) && (kcode < 256)) {
	    scode = _xwin.keycode_to_scancode[kcode];
printf("scode %d\n",scode);
	    if ((scode > 0) && (_xwin_keyboard_interrupt != 0))
	       (*_xwin_keyboard_interrupt)(1, scode);
	 }
	 break;
--------------------------------------------------------------------

-------------------- _xwin_keydrv_handler ------------------
static void _xwin_keydrv_handler(int pressed, int code)
{
   int scancode;

printf("XKH: %x, %x\n",pressed,code);
   /* Handle special scancodes.  */
   if (code & 0x100) {
--------------------------------------------------------------------

And this is stdout when hitting alt:

Event!
Keypress: code 64
scode 219
XKH 1, db

Don't hesitate to ask more info.

-- 
Vincent Penquerc'h
Windows NT - New Trial



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