From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGjUg-0000Ek-0o for qemu-devel@nongnu.org; Wed, 09 Jul 2008 19:54:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGjUe-0000Dd-6r for qemu-devel@nongnu.org; Wed, 09 Jul 2008 19:54:41 -0400 Received: from [199.232.76.173] (port=56206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGjUe-0000DY-3o for qemu-devel@nongnu.org; Wed, 09 Jul 2008 19:54:40 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:59204) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KGjUd-0002OE-GN for qemu-devel@nongnu.org; Wed, 09 Jul 2008 19:54:39 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m69NlcBR003178 for ; Wed, 9 Jul 2008 19:47:38 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m69NqtP0160028 for ; Wed, 9 Jul 2008 17:52:55 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m69Nqt7F020440 for ; Wed, 9 Jul 2008 17:52:55 -0600 Received: from squirrel.codemonkey.ws (sig-9-48-59-15.mts.ibm.com [9.48.59.15]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m69NqsrT020435 for ; Wed, 9 Jul 2008 17:52:54 -0600 Message-ID: <48754F40.3010000@us.ibm.com> Date: Wed, 09 Jul 2008 18:52:32 -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> In-Reply-To: <20080709233752.GL4889@implementation> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable 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 Samuel Thibault wrote: > Tomas Carnecky, le Thu 10 Jul 2008 01:27:49 +0200, a =E9crit : > =20 >> Why is there OS (X11/Windows) specific code in the SDL frontend? And w= hy=20 >> does qemu need keymaps anyway? >> =20 > > The keymaps are for the VNC case, where you get a keyboard symbol, not = a > keycode, so you need to know how to translate back into a scancode. > =20 Actually the keymap is for the case where hardware keycodes are not=20 available. The guest needs hardware keycodes and you typically only get=20 symbolic keycodes. The conversion from symbolic keycodes to hardware=20 keycodes is a 1->many translation so a user needs to explicitly set what=20 the translation is. You could possibly autoguess it by trying to get=20 locale information I guess. SDL in Linux happens to provide hardware keycode information so we don't=20 need to use a keymap. This is not true on Windows SDL though IIRC. =20 Likewise, under normal circumstances, hardware keycodes are not=20 available through VNC. >> I would expect qemu to translate my=20 >> keypresses to corresponding bios scancodes and do no further processin= g.=20 >> =20 > > Yep. > > =20 >> If you do that, you won't need the keymaps code, just a table to=20 >> translate from SDL events to bios scancodes. >> =20 > =20 The problem is this is a 1->many translation. It all depends on what=20 hardware keyboard you are emulation. That is really what you are=20 choosing when you provide a -k option. Regards, Anthony Liguori > In the SDL case that should work indeed. > > Samuel > > > =20