qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Bug in SDL key event processing
Date: Wed, 09 Jul 2008 22:19:20 -0500	[thread overview]
Message-ID: <48757FB8.8010400@codemonkey.ws> (raw)
In-Reply-To: <48755320.5090707@dbservice.com>

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
>
>

  parent reply	other threads:[~2008-07-10  3:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 23:27 [Qemu-devel] Bug in SDL key event processing Tomas Carnecky
2008-07-09 23:37 ` Samuel Thibault
2008-07-09 23:46   ` Tomas Carnecky
2008-07-09 23:55     ` Samuel Thibault
2008-07-10  0:09       ` Tomas Carnecky
2008-07-10  0:20         ` Samuel Thibault
2008-07-10  3:19         ` Anthony Liguori [this message]
2008-07-10  7:56           ` Tomas Carnecky
2008-07-10 13:35             ` Anthony Liguori
2008-07-10 13:43               ` Tomas Carnecky
2008-07-10 13:56                 ` Anthony Liguori
2008-07-10 14:03                 ` Tomas Carnecky
2008-07-10 14:10                   ` Samuel Thibault
2008-07-10 14:20                     ` Tomas Carnecky
2008-07-10 14:49                       ` Samuel Thibault
2008-07-10 14:39                   ` Anthony Liguori
2008-07-10 15:35                     ` Tomas Carnecky
2008-07-10 15:51                       ` Samuel Thibault
2008-07-10 19:25                       ` Anthony Liguori
2008-07-10 19:51                         ` Tomas Carnecky
2008-07-10 21:55                         ` Samuel Thibault
2008-07-10 22:03                           ` Anthony Liguori
2008-07-10 22:14                             ` Samuel Thibault
2008-07-14 16:02                           ` Ian Jackson
2008-07-14 16:27                             ` Samuel Thibault
2008-07-14 16:01                         ` Ian Jackson
2008-07-09 23:52   ` Anthony Liguori
2008-07-10 12:03     ` Jamie Lokier
2008-07-10 12:24       ` Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2008-07-10 14:22 Juergen Keil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48757FB8.8010400@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).