From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGxJe-0002dW-PA for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:40:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGxJd-0002cX-Bi for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:40:14 -0400 Received: from [199.232.76.173] (port=44295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGxJd-0002cU-2R for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:40:13 -0400 Received: from py-out-1112.google.com ([64.233.166.180]:25466) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGxJc-0005Pz-JN for qemu-devel@nongnu.org; Thu, 10 Jul 2008 10:40:12 -0400 Received: by py-out-1112.google.com with SMTP id p76so1847633pyb.10 for ; Thu, 10 Jul 2008 07:40:10 -0700 (PDT) Message-ID: <48761F31.4090909@codemonkey.ws> Date: Thu, 10 Jul 2008 09:39:45 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Bug in SDL key event processing References: <48754975.1050303@dbservice.com> <20080709233752.GL4889@implementation> <48754DF2.2010704@dbservice.com> <20080709235516.GM4889@implementation> <48755320.5090707@dbservice.com> <48757FB8.8010400@codemonkey.ws> <4875C0B6.2060302@dbservice.com> <4876101A.1080800@codemonkey.ws> <487611FC.5070500@dbservice.com> <487616BB.8020402@dbservice.com> In-Reply-To: <487616BB.8020402@dbservice.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: 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 Tomas Carnecky wrote: > 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. Having to use keysym.sym means that -k is *always* required. So it looks like we need to detect when the keycodes translation is not xfree86 and insist that a -k option is passed. Regards, Anthony Liguori > Am I the only one who uses the evdev driver and runs QEMU? I can't > believe that. > > tom > >