qemu-devel
[Top][All Lists]
Advanced

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

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


From: Tomas Carnecky
Subject: Re: [Qemu-devel] Bug in SDL key event processing
Date: Thu, 10 Jul 2008 16:03:39 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080621)

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.

tom




reply via email to

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