From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGmhC-0006YX-1M for qemu-devel@nongnu.org; Wed, 09 Jul 2008 23:19:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGmhA-0006WN-2H for qemu-devel@nongnu.org; Wed, 09 Jul 2008 23:19:49 -0400 Received: from [199.232.76.173] (port=40760 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGmh9-0006W1-S1 for qemu-devel@nongnu.org; Wed, 09 Jul 2008 23:19:47 -0400 Received: from yw-out-1718.google.com ([74.125.46.154]:26616) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KGmh9-0002cf-Ro for qemu-devel@nongnu.org; Wed, 09 Jul 2008 23:19:47 -0400 Received: by yw-out-1718.google.com with SMTP id 6so1468919ywa.82 for ; Wed, 09 Jul 2008 20:19:46 -0700 (PDT) Message-ID: <48757FB8.8010400@codemonkey.ws> Date: Wed, 09 Jul 2008 22:19:20 -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> In-Reply-To: <48755320.5090707@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: > Fair enough. I didn't know that. > > But you said it yourself, SDL doesn't need the keymap table, it can > translate the keycodes on its own. So where is the need to share the > keymaps? Do other frontends need the keymaps as well? > Anyway, whatever you do, please don't try to be smart, parse the SDL > 'scancode' (which is the X11 keycode) and use that to get the 'real' > scancode. What you're saying is inaccurate. It's a confusing topic, so it's useful to get terminology straight. There are two values available in SDL. The first is the SDL keyval. This is close to, but not guaranteed to be 100% compatible with X11 keycodes. You cannot get a PS/2 scancode directly from the keyval. You must use a locale-specific translation table. SDL also supports a hardware keycode field. This field is not guaranteed to be filled out--it's not filled out on Windows. As a user-friendly optimization, if there is a valid hardware keycode field, we use that instead of using the locale-specific translation table. The hardware keycode field can be translated to a PS/2 scancode. > Maybe that works under win32, but under linux, the SDL scancode isn't > guaranteed to be usable as an index into your x_keycode_to_pc_keycode > table. 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? 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). Regards, Anthony Liguori > tom > >