hid keyboard event handling
Hi Gerd,
i have another issue. This time with the hid keyboard rework (commit 1ff5eedd). Before this commit, a press of, for example the windows key, resulted in two calls of the hs->event() callback. Eg. there were two events queued and two callbacks. But after your commit, two events are queued (see for loop in hid_keyboard_event()) but there is now only one callback.
My input device model (milkymist-softusb.c) polls (hid_keyboard_poll()) exactly once per event callback. Actually, i don't see any other way to do it because the hid_keyboard_poll() always succeeds even if there is no event in the queue.
So at the moment, if you press the windows key, the event queue fills by two but only one entry is fetched from the device model and eventually the queue is full.
-michael
Hi,
Quoted 4 lines
My input device model (
milkymist-softusb.c) polls (hid_keyboard_poll()) exactly once per event callback. Actually, i don't see any other way to do it because thehid_keyboard_poll()always succeeds even if there is no event in the queue.
You can use hid_has_events() to figure whenever there are events in the queue or not.
cheers,
Gerd
Am 2014-10-01 16:17, schrieb Gerd Hoffmann:
Quoted 9 lines
Hi,
Quoted 4 lines
My input device model (
milkymist-softusb.c) polls (hid_keyboard_poll()) exactly once per event callback. Actually, i don't see any other way to do it because thehid_keyboard_poll()always succeeds even if there is no event in the queue.You can use
hid_has_events()to figure whenever there are events in the queue or not.
Oh, didn't see that function. Thanks, that should do the trick.
-michael