qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 6/9] spice: add keyboard


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 6/9] spice: add keyboard
Date: Fri, 20 Aug 2010 14:34:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Red Hat/3.1.1-1.el6 Thunderbird/3.1.1


+static const SpiceKbdInterface kbd_interface = {
+ .base.type = SPICE_INTERFACE_KEYBOARD,
+ .base.description = "qemu keyboard",
+ .base.major_version = SPICE_INTERFACE_KEYBOARD_MAJOR,
+ .base.minor_version = SPICE_INTERFACE_KEYBOARD_MINOR,
+ .push_scan_freg = kbd_push_key,
+ .get_leds = kbd_get_leds,
+};
+
+static void kbd_push_key(SpiceKbdInstance *sin, uint8_t frag)
+{
+ kbd_put_keycode(frag);
+}

Instead of using this interface which includes multi-byte sequences, it
would probably make sense to use the same compressed encoding that VNC
uses and introduce a new function that takes this encoding type. The
advantage is that one call == one keycode so it's far less prone to
goofiness.

Hmm?  Not sure what you want here ...

kbd_push_key is called by libspice which feeds us with a ps/2 data stream for the keyboard. Yes, one of those x86-isms in spice. Yes, the ps/2 data stream also travels over the wire, i.e. the spice client has to hop through loops to convert whatever it gets into a ps/2 data stream for us.

Luckily ps/2 data is exactly what qemu expects to get via kbd_put_keycode, so I can simply pass on what I get, and it is IMHO pretty pointless to do something else ...

It's probably more robust in the long term to explicitly convert the
ledstate to from the QEMU format to the libspice format even if they
both happen to be the same.

Ok.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]