|
@@ -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;
|
|
|
}
|
|
|
|