mirror of https://github.com/xemu-project/xemu.git
milkymist: softmmu: fix event handling
Keys which send more than one scancode (esp. windows key) weren't handled
correctly since commit 1ff5eedd
. Two events were put into the input event
queue but only one was processed. This fixes this by fetching all pending
events in the callback handler.
Signed-off-by: Michael Walle <michael@walle.cc>
Cc: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
ab0302ee76
commit
857cccac0d
|
@ -194,11 +194,14 @@ static void softusb_kbd_hid_datain(HIDState *hs)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = hid_keyboard_poll(hs, s->kbd_hid_buffer, sizeof(s->kbd_hid_buffer));
|
while (hid_has_events(hs)) {
|
||||||
|
len = hid_keyboard_poll(hs, s->kbd_hid_buffer,
|
||||||
|
sizeof(s->kbd_hid_buffer));
|
||||||
|
|
||||||
if (len == 8) {
|
if (len == 8) {
|
||||||
softusb_kbd_changed(s);
|
softusb_kbd_changed(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void softusb_mouse_hid_datain(HIDState *hs)
|
static void softusb_mouse_hid_datain(HIDState *hs)
|
||||||
|
@ -212,12 +215,14 @@ static void softusb_mouse_hid_datain(HIDState *hs)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (hid_has_events(hs)) {
|
||||||
len = hid_pointer_poll(hs, s->mouse_hid_buffer,
|
len = hid_pointer_poll(hs, s->mouse_hid_buffer,
|
||||||
sizeof(s->mouse_hid_buffer));
|
sizeof(s->mouse_hid_buffer));
|
||||||
|
|
||||||
if (len == 4) {
|
if (len == 4) {
|
||||||
softusb_mouse_changed(s);
|
softusb_mouse_changed(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void milkymist_softusb_reset(DeviceState *d)
|
static void milkymist_softusb_reset(DeviceState *d)
|
||||||
|
|
Loading…
Reference in New Issue