From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGjj2-0007hz-80 for qemu-devel@nongnu.org; Wed, 09 Jul 2008 20:09:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGjj1-0007hD-6f for qemu-devel@nongnu.org; Wed, 09 Jul 2008 20:09:31 -0400 Received: from [199.232.76.173] (port=39249 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGjj1-0007hA-2c for qemu-devel@nongnu.org; Wed, 09 Jul 2008 20:09:31 -0400 Received: from dbservice.com ([213.239.204.14]:39321 helo=matterhorn.dbservice.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGjj0-0006Sa-B1 for qemu-devel@nongnu.org; Wed, 09 Jul 2008 20:09:30 -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 3D19120BB3BF for ; Thu, 10 Jul 2008 02:09:19 +0200 (CEST) Message-ID: <48755320.5090707@dbservice.com> Date: Thu, 10 Jul 2008 02:09:04 +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> In-Reply-To: <20080709235516.GM4889@implementation> Content-Type: text/plain; charset=UTF-8; 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:46:58 +0200, a =C3=A9crit : >> Samuel Thibault wrote: >>> Tomas Carnecky, le Thu 10 Jul 2008 01:27:49 +0200, a =C3=A9crit : >>>> Why is there OS (X11/Windows) specific code in the SDL frontend? And= why=20 >>>> does qemu need keymaps anyway? >>> The keymaps are for the VNC case, where you get a keyboard symbol, no= t a >>> keycode, so you need to know how to translate back into a scancode. >> Well, every 'frontend' needs some kind of keymap table to map the even= ts=20 >> into bios scancodes. >=20 > The VNC frontend can not do that without keymap information, and that > information can be shared, and should be shared >=20 > There is a fundamental difference between SDL and VNC: >=20 > - SDL gets keycode, i.e. the _positional_ number of a key, i.e. for > instance the 1st key of the second row, which happens to be a Q on a > qwerty keyboard. That can be translated into scancodes with a fixed map > table. > - VNC gets symbols, i.e. the _semantic_ of a key, i.e. for instance 'Q'= , > which has to be translated into a scancode, and there you have the > problem of the expected layout of the keyboard: should that be > translated into scancode for the 1st key of the 2nd row, or for the 1st > key of the 3rd row (because the user has an azerty keyboard). >=20 Fair enough. I didn't know that. But you said it yourself, SDL doesn't need the keymap table, it can=20 translate the keycodes on its own. So where is the need to share the=20 keymaps? Do other frontends need the keymaps as well? Anyway, whatever you do, please don't try to be smart, parse the SDL=20 'scancode' (which is the X11 keycode) and use that to get the 'real'=20 scancode. Maybe that works under win32, but under linux, the SDL=20 scancode isn't guaranteed to be usable as an index into your=20 x_keycode_to_pc_keycode table. tom