diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-07-15 15:52:33 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-08-04 15:51:51 +0200 |
commit | b069d3488f327da97fb0da1939518a00637f01a3 (patch) | |
tree | 36f5a720c2d2675e9dcc5816d79b6d6e93d0a7f2 /hw/hid.c | |
parent | dcfda673101313472524bfac8c2fe2e1d03c8214 (diff) |
hid: move idle+protocol from usb-hid to hid too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/hid.c')
-rw-r--r-- | hw/hid.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -24,6 +24,7 @@ */ #include "hw.h" #include "console.h" +#include "qemu-timer.h" #include "hid.h" #define HID_USAGE_ERROR_ROLLOVER 0x01 @@ -73,6 +74,11 @@ bool hid_has_events(HIDState *hs) return hs->n > 0; } +void hid_set_next_idle(HIDState *hs, int64_t curtime) +{ + hs->next_idle_clock = curtime + (get_ticks_per_sec() * hs->idle * 4) / 1000; +} + static void hid_pointer_event_clear(HIDPointerEvent *e, int buttons) { e->xdx = e->ydy = e->dz = 0; @@ -365,6 +371,8 @@ void hid_reset(HIDState *hs) } hs->head = 0; hs->n = 0; + hs->protocol = 1; + hs->idle = 0; } void hid_free(HIDState *hs) |