usb-hid: modifiers should generate an event
When a modifier key is pressed or released, the USB HID keyboard still answers NAK, unless another key is also pressed or released. The patch fixes that by calling usb_hid_changed() when a modifier key is pressed or released. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
de4af5f792
commit
373dfc441d
@ -460,15 +460,18 @@ static void usb_keyboard_event(void *opaque, int keycode)
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user