Process Qukeys queue after checking timeout in afterEachCycle()

To prevent the possibility of a call to `flushEvent()` when the queue is empty,
we call `processQueue()` (which checks for an empty queue) after checking the
hold timeout, rather than before.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1107/head
Michael Richters 3 years ago
parent c1bb8b2545
commit c3ea0876c1
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -88,9 +88,6 @@ EventHandlerResult Qukeys::afterEachCycle() {
return EventHandlerResult::OK;
}
// Process as many events as we can from the queue.
while (processQueue());
// If we get here, that means that the first event in the queue is a qukey
// press. All that's left to do is to check if it's been held long enough that
// it has timed out.
@ -101,6 +98,10 @@ EventHandlerResult Qukeys::afterEachCycle() {
queue_head_.primary_key : queue_head_.alternate_key;
flushEvent(event_key);
}
// Process as many events as we can from the queue.
while (processQueue());
return EventHandlerResult::OK;
}

Loading…
Cancel
Save