提交 e7e73892 编写于 作者: G Gerd Hoffmann

usb-hid: fixup changed tracking.

Remove leftover calls to usb_hid_changed().

Take care to update the changed flag after delivering a event via
GET_REPORT like we do when sending events via interrupt endpoint.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 d1afc48b
...@@ -531,18 +531,15 @@ static void usb_keyboard_process_keycode(USBHIDState *hs) ...@@ -531,18 +531,15 @@ static void usb_keyboard_process_keycode(USBHIDState *hs)
case 0xe0: case 0xe0:
if (s->modifiers & (1 << 9)) { if (s->modifiers & (1 << 9)) {
s->modifiers ^= 3 << 8; s->modifiers ^= 3 << 8;
usb_hid_changed(hs);
return; return;
} }
case 0xe1 ... 0xe7: case 0xe1 ... 0xe7:
if (keycode & (1 << 7)) { if (keycode & (1 << 7)) {
s->modifiers &= ~(1 << (hid_code & 0x0f)); s->modifiers &= ~(1 << (hid_code & 0x0f));
usb_hid_changed(hs);
return; return;
} }
case 0xe8 ... 0xef: case 0xe8 ... 0xef:
s->modifiers |= 1 << (hid_code & 0x0f); s->modifiers |= 1 << (hid_code & 0x0f);
usb_hid_changed(hs);
return; return;
} }
...@@ -769,10 +766,12 @@ static int usb_hid_handle_control(USBDevice *dev, USBPacket *p, ...@@ -769,10 +766,12 @@ static int usb_hid_handle_control(USBDevice *dev, USBPacket *p,
} }
break; break;
case GET_REPORT: case GET_REPORT:
if (s->kind == USB_MOUSE || s->kind == USB_TABLET) if (s->kind == USB_MOUSE || s->kind == USB_TABLET) {
ret = usb_pointer_poll(s, data, length); ret = usb_pointer_poll(s, data, length);
else if (s->kind == USB_KEYBOARD) } else if (s->kind == USB_KEYBOARD) {
ret = usb_keyboard_poll(s, data, length); ret = usb_keyboard_poll(s, data, length);
}
s->changed = s->n > 0;
break; break;
case SET_REPORT: case SET_REPORT:
if (s->kind == USB_KEYBOARD) if (s->kind == USB_KEYBOARD)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册