[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Bug in SDL key event processing

From: Juergen Keil
Subject: Re: [Qemu-devel] Bug in SDL key event processing
Date: Thu, 10 Jul 2008 16:22:41 +0200 (CEST)

> QEMU assumes that the xserver uses the xfree86 model. See files in 
> /usr/share/X11/xkb/keycodes/, especially 'xfree86' and 'evdev'. The 
> files translate from scancodes that the drivers generate into xserver 
> keycodes. The xfree86 file has '<UP> = 98', meaning that if the xkb 
> driver generates 98 it means the user pressed the UP key. When QEMU uses 
> `98 - 97` as the index into the x_keycode_to_pc_keycode table, which 
> yields the correct Up scancode. But the 'evdev' keycode file in the xkb 
> directory has '<UP> = 111', meaning that the evdev driver generates 
> keycode 111 for the UP key.
> Again, you _can not_ assume that the X keycode (XKeyEvent.keycode or 
> SDL_KeyboardEvent.scancode) has any particular meaning. If you run on 
> pure X11, you have to translate it into a keysym (XKeycodeToKeysym()) 
> and use that instead. If you run on SDL, you have to use keysym.sym.
> Am I the only one who uses the evdev driver and runs QEMU? I can't 
> believe that.

Yes, the same issue exists when displaying to a non-Xorg server,
e.g. the Xsun server on a Solaris/SPARC.

With an US English layout keyboard on the Solaris/SPARC machine,
I get keycode 27 in xev (which translates to keysym 0xff52, "Up").

Qemu's sdl keyboard layout is broken when displaying to Xsun, unless I 
use "-k en-us".

reply via email to

[Prev in Thread] Current Thread [Next in Thread]