From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGx2n-0007n0-K6 for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:22:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGx2l-0007mc-3m for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:22:48 -0400 Received: from [199.232.76.173] (port=58583 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGx2l-0007mZ-1G for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:22:47 -0400 Received: from kurt.tools.de ([192.76.135.70]:36074) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KGx2k-0006Vv-LC for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:22:46 -0400 Received: from imap.tools.intra (homes.tools.intra [172.20.0.4]) by kurt.TooLs.DE (Postfix) with ESMTP id 99A2E45814 for ; Thu, 10 Jul 2008 16:22:41 +0200 (MEST) Received: from tiger2.tools.intra (tiger2.tools.intra [172.20.0.11]) by imap.tools.intra (Postfix) with SMTP id 713564F49A for ; Thu, 10 Jul 2008 16:22:41 +0200 (CEST) Date: Thu, 10 Jul 2008 16:22:41 +0200 (CEST) From: Juergen Keil Subject: Re: [Qemu-devel] Bug in SDL key event processing MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: 5/1viLk9pQ1ZCPWQiGV//A== Message-Id: <20080710142241.713564F49A@imap.tools.intra> Reply-To: Juergen Keil , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > 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 ' = 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 ' = 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".