All of lore.kernel.org
 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: Thu, 10 Jul 2008 08:35:22 -0500	[thread overview]
Message-ID: <4876101A.1080800@codemonkey.ws> (raw)
In-Reply-To: <4875C0B6.2060302@dbservice.com>

Tomas Carnecky wrote:
> 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.

No.  keysym.sym = SDLK_UP.  scancode=111 presumably.

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

What I assume is happening is that your host keyboard is not setup as 
en-us but your guest is confused with en-us.  That would cause the 
behavior you're seeing.

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

What keyboard do you have?  What is your host and guest locale?

Regards,

Anthony Liguoiri

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

  reply	other threads:[~2008-07-10 13:35 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
2008-07-10  7:56           ` Tomas Carnecky
2008-07-10 13:35             ` Anthony Liguori [this message]
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=4876101A.1080800@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.