From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGrQi-0001sr-BH for qemu-devel@nongnu.org; Thu, 10 Jul 2008 04:23:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGrQf-0001pc-JH for qemu-devel@nongnu.org; Thu, 10 Jul 2008 04:23:07 -0400 Received: from [199.232.76.173] (port=38739 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGrQf-0001pQ-F8 for qemu-devel@nongnu.org; Thu, 10 Jul 2008 04:23:05 -0400 Received: from mx20.gnu.org ([199.232.41.8]:10405) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KGrQf-0000yX-Ch for qemu-devel@nongnu.org; Thu, 10 Jul 2008 04:23:05 -0400 Received: from dbservice.com ([213.239.204.14] helo=matterhorn.dbservice.com) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGr1X-0005ai-Kw for qemu-devel@nongnu.org; Thu, 10 Jul 2008 03:57:07 -0400 Received: from [192.168.0.27] (gw.ptr-62-65-141-13.customer.ch.netstream.com [62.65.141.13]) by matterhorn.dbservice.com (Postfix) with ESMTP id ECB8220BB3BF for ; Thu, 10 Jul 2008 09:56:52 +0200 (CEST) Message-ID: <4875C0B6.2060302@dbservice.com> Date: Thu, 10 Jul 2008 09:56:38 +0200 From: Tomas Carnecky 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> In-Reply-To: <48757FB8.8010400@codemonkey.ws> 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 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. 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. 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'. > 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