From 6036e908f50098e86619b25ecc818b5ee2906a06 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Sat, 21 Apr 2018 22:48:54 -0500 Subject: [PATCH] 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. --- src/Kaleidoscope/Qukeys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kaleidoscope/Qukeys.cpp b/src/Kaleidoscope/Qukeys.cpp index 7ecb7a2c..e6b94523 100644 --- a/src/Kaleidoscope/Qukeys.cpp +++ b/src/Kaleidoscope/Qukeys.cpp @@ -241,7 +241,7 @@ bool Qukeys::isQukey(uint8_t addr) { 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 (row >= ROWS || col >= COLS) + if (row >= ROWS || col >= COLS || (key_state & INJECTED) != 0) return mapped_key; // If Qukeys is turned off, continue to next plugin