Ignore any event with INJECTED flag

Any event with the `INJECTED` flag set is now ignored. This is necessary because OneShot
now sends events with valid `row` & `col` values when it calls `handleKeyswitchEvent()`,
and we need to make sure those events don't get enqueued in the case of a qukey whose
primary keycode value is a OSM key, followed by a key that is meant to be modified by that
key. Fixes #40.
pull/389/head
Michael Richters 7 years ago
parent e2519b440b
commit 6036e908f5

@ -241,7 +241,7 @@ bool Qukeys::isQukey(uint8_t addr) {
Key Qukeys::keyScanHook(Key mapped_key, byte row, byte col, uint8_t key_state) { Key Qukeys::keyScanHook(Key mapped_key, byte row, byte col, uint8_t key_state) {
// If key_addr is not a physical key, ignore it; some other plugin injected it // If key_addr is not a physical key, ignore it; some other plugin injected it
if (row >= ROWS || col >= COLS) if (row >= ROWS || col >= COLS || (key_state & INJECTED) != 0)
return mapped_key; return mapped_key;
// If Qukeys is turned off, continue to next plugin // If Qukeys is turned off, continue to next plugin

Loading…
Cancel
Save