input: misc fixes.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJUwN6pAAoJEEy22O7T6HE4St8P/1d26YYIC2DMfWsrTM/pLQlq
 QDpYyeU51xOv59BKgRHchNMNS6AygJ3m6sWXwCq7lfsHEGVLJtlPXPIPDMD/pHc1
 xKchw5IsWkjVBaiVPgjFA3p4YcRbpUiarO60sP5bk3dzyuJvBPglc5dyMqCuLbVu
 EfhApw4Bpk7b07pC3/6G4TS5WkAYjbC1uLn5cd0ClaPaYuh2a73Tlo92K/DOXHG2
 bJtZTpfu5I69vVn8+tdnn6lz4PHycxh3NjQNw3QqgvOm97VZhW9iv6S5konyi1lq
 qeVEs9loFx8zlxKIaSFQOuC/JEtZ03hpKp8H0No+KxE1zU247kZpRbeR6HT3fSD5
 lMLHOs55+Nk2h8T+IEC0E7UPx+o1hELMLvjmNmM7dxVHUV/R3oq+rb98a1fMFr8r
 5n7qUKQJm03GFM6YsCGjnyV64DjUvl3ASh6yzHZ4tL7hA2rmZT+G38mxm84ScwP6
 dlFRR0707uZarnj8vz6Tr6ehAbUr6ylf7JpE4JsqluDHaGyY0rBgPkg2x50uqyd9
 ek2Nk7+jMpLUWrKGUQmOJjmDAb1tmOcFriZfg6duhAwlLFH9b4U0p47UvWkusGKq
 o/fZBLr0QPYYde7NlBNMWu3tmLi/1vYPCH8LaSmRPCNLgTO5vOTGed1FCqLiWq+a
 joYJUL9tzL6PSIqQ56m2
 =247P
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20150122-1' into staging

input: misc fixes.

# gpg: Signature made Thu 22 Jan 2015 11:27:37 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-input-20150122-1:
  hw/input/hid.c Fix capslock hid code
  hid: handle full ptr queues in post_load
  input: improve docs for input-send-event qmp command

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
master
Peter Maydell 2015-01-22 17:41:59 +00:00
commit 8f970eff6e
2 changed files with 34 additions and 1 deletions

View File

@ -41,7 +41,7 @@ static const uint8_t hid_usage_keys[0x100] = {
0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x0f, 0x33,
0x34, 0x35, 0xe1, 0x31, 0x1d, 0x1b, 0x06, 0x19,
0x05, 0x11, 0x10, 0x36, 0x37, 0x38, 0xe5, 0x55,
0xe2, 0x2c, 0x32, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
0xe2, 0x2c, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
0x3f, 0x40, 0x41, 0x42, 0x43, 0x53, 0x47, 0x5f,
0x60, 0x61, 0x56, 0x5c, 0x5d, 0x5e, 0x57, 0x59,
0x5a, 0x5b, 0x62, 0x63, 0x00, 0x00, 0x00, 0x44,
@ -514,6 +514,27 @@ static int hid_post_load(void *opaque, int version_id)
HIDState *s = opaque;
hid_set_next_idle(s);
if (s->n == QUEUE_LENGTH && (s->kind == HID_TABLET ||
s->kind == HID_MOUSE)) {
/*
* Handle ptr device migration from old qemu with full queue.
*
* Throw away everything but the last event, so we propagate
* at least the current button state to the guest. Also keep
* current position for the tablet, signal "no motion" for the
* mouse.
*/
HIDPointerEvent evt;
evt = s->ptr.queue[(s->head+s->n) & QUEUE_MASK];
if (s->kind == HID_MOUSE) {
evt.xdx = 0;
evt.ydy = 0;
}
s->ptr.queue[0] = evt;
s->head = 0;
s->n = 1;
}
return 0;
}

View File

@ -3329,6 +3329,18 @@
# Send input event(s) to guest.
#
# @console: #optional console to send event(s) to.
# This parameter can be used to send the input event to
# specific input devices in case (a) multiple input devices
# of the same kind are added to the virtual machine and (b)
# you have configured input routing (see docs/multiseat.txt)
# for those input devices. If input routing is not
# configured this parameter has no effect.
# If @console is missing, only devices that aren't associated
# with a console are admissible.
# If @console is specified, it must exist, and both devices
# associated with that console and devices not associated with a
# console are admissible, but the former take precedence.
#
# @events: List of InputEvent union.
#