From: Tomas Carnecky <tom@dbservice.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Bug in SDL key event processing
Date: Thu, 10 Jul 2008 02:09:04 +0200 [thread overview]
Message-ID: <48755320.5090707@dbservice.com> (raw)
In-Reply-To: <20080709235516.GM4889@implementation>
Samuel Thibault wrote:
> Tomas Carnecky, le Thu 10 Jul 2008 01:46:58 +0200, a écrit :
>> Samuel Thibault wrote:
>>> Tomas Carnecky, le Thu 10 Jul 2008 01:27:49 +0200, a écrit :
>>>> Why is there OS (X11/Windows) specific code in the SDL frontend? And why
>>>> does qemu need keymaps anyway?
>>> 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.
>> Well, every 'frontend' needs some kind of keymap table to map the events
>> into bios scancodes.
>
> The VNC frontend can not do that without keymap information, and that
> information can be shared, and should be shared
>
> There is a fundamental difference between SDL and VNC:
>
> - 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).
>
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. 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.
tom
next prev parent reply other threads:[~2008-07-10 0:09 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 [this message]
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
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=48755320.5090707@dbservice.com \
--to=tom@dbservice.com \
--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).