From a393f4778e09e3dcf6527c4d50c11a474024ac59 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Mon, 16 Nov 2020 01:32:48 -0600 Subject: [PATCH] Suppress idle keyswitch events from virtual hardware device The virtual hardware device, unlike others, was calling `handleKeyswitchEvent()` for every keyswitch, every cycle. It should suppress calls corresponding to idle keyswitches, just like the other devices. Signed-off-by: Michael Richters --- src/kaleidoscope/device/virtual/Virtual.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kaleidoscope/device/virtual/Virtual.cpp b/src/kaleidoscope/device/virtual/Virtual.cpp index 387719d8..68ca3835 100644 --- a/src/kaleidoscope/device/virtual/Virtual.cpp +++ b/src/kaleidoscope/device/virtual/Virtual.cpp @@ -260,7 +260,8 @@ void VirtualKeyScanner::actOnMatrixScan() { break; } - handleKeyswitchEvent(Key_NoKey, key_addr, key_state); + if (key_state != 0) + handleKeyswitchEvent(Key_NoKey, key_addr, key_state); keystates_prev_[key_addr.toInt()] = keystates_[key_addr.toInt()]; if (keystates_[key_addr.toInt()] == KeyState::Tap) {