All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/9] spice: add keyboard
Date: Fri, 20 Aug 2010 15:15:09 +0100	[thread overview]
Message-ID: <20100820141509.GL16437@redhat.com> (raw)
In-Reply-To: <4C6E89A4.2060906@redhat.com>

On Fri, Aug 20, 2010 at 03:56:52PM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> >It's not actually ps/2 data. It's AT scan codes plus an internal
> >encoding to indicate press vs. release using the high bit. Additionally,
> >some special keys are encoded with two calls to kbd_put_keycode using
> >the 0xe0 prefix (the grey code).
> 
> Wheee.  From a brief look at the code it seems this *is* the spice wire 
> protocol.  One more place where spice uses knowledge about qemu 
> internals.  Unfortunaly this one escaped my attention until now, so it 
> didn't got fixed :-(
> 
> >So what I'm proposing is that we modify kbd_put_keycode to also reflect
> >this:
> >
> >// normal keys
> >kbd_keycode_press(at_keycode); // PS/2 at2raw(at_keycode)
> >kbd_keycode_release(at_keycode); // PS/2 0xf0, at2raw(at_keycode)
> >
> >// grey keys; PS/2 0xe0, at2raw(at_keycode)
> >kbd_keycode_press(0x80 | at_keycode); // PS/2 0xe0, 0xf0,
> >at2raw(at_keycode)
> >kbd_keycode_release(0x80 | at_keycode); // PS/2 0xe0, 0xf0,
> >at2raw(at_keycode)
> >
> >If it's not already too late, I'd suggest making this the Spice protocol
> >interface.
> 
> No.  I think for now I have to deal with the mess in case qemu decides 
> to change the internal interface.  And when ever touching the spice wire 
> protocol to fixup this mess I will *not* use AT keycodes.  Handling 
> anything with extra internet / multimedia / whatever keys in a sane way 
> is simply impossible with AT keycodes.  linux input layer key codes 
> should do.  maybe usb hid is usable too, need to check.

AT (well XT) keycodes aren't that bad a choice, at least if you go for the
extended mapping used by the Linux keyboard driver. This supports pretty
much all of the internet/multimedia keys, AFAICT, more than USB hid
does (at least in the Linux USB HID driver). In order to properly support
the VNC keycode extension with GTK-VNC under  Xorg + Win32, OS-X and Linux,
as well as native OS-X & Win32, I've created a giant CSV mapping file for
all keycode sets that I've encountered so far.

The master mapping is from Linux keycodes to other sets:

  http://git.gnome.org/browse/gtk-vnc/tree/src/keymaps.csv

And a tool that can then create you C arrays for mapping between
arbitrary keycode sets in any direction (potentially lossy
of course, depending on choice of keycode sets):

  http://git.gnome.org/browse/gtk-vnc/tree/src/keymap-gen.pl

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  reply	other threads:[~2010-08-20 14:15 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19 12:40 [Qemu-devel] [PATCH 0/9] initial spice support Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 1/9] add pflib: PixelFormat conversion library Gerd Hoffmann
2010-08-19 14:04   ` Anthony Liguori
2010-08-19 15:34     ` Gerd Hoffmann
2010-08-19 19:09       ` Anthony Liguori
2010-08-20 10:38         ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 2/9] configure: add logging Gerd Hoffmann
2010-08-19 14:05   ` Anthony Liguori
2010-08-19 15:44     ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 3/9] add spice into the configure file Gerd Hoffmann
2010-08-19 14:06   ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 4/9] configure: require spice 0.5.3 Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 5/9] spice: core bits Gerd Hoffmann
2010-08-19 14:19   ` Anthony Liguori
2010-08-20 11:54     ` Gerd Hoffmann
2010-08-25 12:37     ` Gerd Hoffmann
2010-08-19 12:40 ` [Qemu-devel] [PATCH 6/9] spice: add keyboard Gerd Hoffmann
2010-08-19 14:24   ` Anthony Liguori
2010-08-20 12:34     ` Gerd Hoffmann
2010-08-20 13:18       ` Anthony Liguori
2010-08-20 13:56         ` Gerd Hoffmann
2010-08-20 14:15           ` Daniel P. Berrange [this message]
2010-08-20 14:49             ` Gerd Hoffmann
2010-08-20 15:01               ` Daniel P. Berrange
2010-08-19 12:40 ` [Qemu-devel] [PATCH 7/9] spice: add mouse Gerd Hoffmann
2010-08-19 14:25   ` Anthony Liguori
2010-08-20 12:42     ` Gerd Hoffmann
2010-08-20 13:19       ` Anthony Liguori
2010-08-20 14:03         ` Gerd Hoffmann
2010-08-20 14:37           ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 8/9] spice: simple display Gerd Hoffmann
2010-08-19 14:39   ` Anthony Liguori
2010-08-19 15:23     ` malc
2010-08-19 15:34       ` Anthony Liguori
2010-08-19 15:36         ` malc
2010-08-19 19:03           ` Anthony Liguori
2010-08-19 19:10             ` malc
2010-08-19 15:40         ` Alexander Graf
2010-08-25 11:09           ` Gerd Hoffmann
2010-08-19 16:05     ` Gerd Hoffmann
2010-08-19 19:00       ` Anthony Liguori
2010-08-19 12:40 ` [Qemu-devel] [PATCH 9/9] spice: add tablet support Gerd Hoffmann
2010-08-19 14:40   ` Anthony Liguori

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=20100820141509.GL16437@redhat.com \
    --to=berrange@redhat.com \
    --cc=kraxel@redhat.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 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.