From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGwJN-0001fa-TV for qemu-devel@nongnu.org; Thu, 10 Jul 2008 09:35:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGwJL-0001cx-7L for qemu-devel@nongnu.org; Thu, 10 Jul 2008 09:35:53 -0400 Received: from [199.232.76.173] (port=50596 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGwJK-0001cl-KO for qemu-devel@nongnu.org; Thu, 10 Jul 2008 09:35:50 -0400 Received: from py-out-1112.google.com ([64.233.166.181]:40537) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGwJK-0002j7-2K for qemu-devel@nongnu.org; Thu, 10 Jul 2008 09:35:50 -0400 Received: by py-out-1112.google.com with SMTP id p76so1827741pyb.10 for ; Thu, 10 Jul 2008 06:35:49 -0700 (PDT) Message-ID: <4876101A.1080800@codemonkey.ws> Date: Thu, 10 Jul 2008 08:35:22 -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> In-Reply-To: <4875C0B6.2060302@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: > Anthony Liguori wrote: >> What's lost in your ranting is a concise description of the problem >> you've encountered. What behavior are you seeing and what behavior >> do you expect to see? What kind of physical keyboard do you have and >> what is your keyboard configured as in your host and in your guest? >> Are you using a '-k' option? > > When I press the 'Up' key, the xserver generates an event with keycode > 111 (tested with xev). SDL repacks the XEvent to a SDL_KeyboardEvent > with keycode=SDLK_UP and scancode=111. No. keysym.sym = SDLK_UP. scancode=111 presumably. > If I don't supply a keymap name (-k), QEMU uses the SDL scancode as > the index into the x_keycode_to_pc_keycode table, but that table > incorrectly translates it to 'Print'. If I use '-k en-us', the QEMU > sets up a correct SDL-keysym-to-scancode table and then all keys work. What I assume is happening is that your host keyboard is not setup as en-us but your guest is confused with en-us. That would cause the behavior you're seeing. > > You cannot use the SDL scancode under X11, because there's no > guarantee that it has any meaningful value. X11 clients have to > translate they keycode to a keysym using XKeycodeToKeysym() to get the > real value, which you can then for example compare with 'XK_Up'. What keyboard do you have? What is your host and guest locale? Regards, Anthony Liguoiri >> I'd be willing to wager that whatever problem you are encountering is >> a configuration error on your part (unless you're using a >> infrequently tested translation table). > > I ran vanilla kvm-userspace.git. Sure, it's not the same as qemu, but > I doubt the kvm developers wrote that part of the code. I haven't > modified any existing code or keymap files, just added a few printf()s > to see what's going on. > > > tom > > >