From 5d69eca65d668f969fee92c13402c1857d3d42da Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 6 Apr 2021 19:15:20 -0500 Subject: [PATCH] Update testcase for issue 978 Signed-off-by: Michael Richters --- tests/issues/978/978.ino | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/issues/978/978.ino b/tests/issues/978/978.ino index a9e0b0e7..c2401b72 100644 --- a/tests/issues/978/978.ino +++ b/tests/issues/978/978.ino @@ -18,10 +18,6 @@ #include "./common.h" -#undef min -#undef max -#include - // *INDENT-OFF* KEYMAPS( [0] = KEYMAP_STACKED @@ -48,9 +44,12 @@ namespace plugin { class IdleKeyDetector : public kaleidoscope::Plugin { public: - EventHandlerResult onKeyswitchEvent(Key &key, KeyAddr key_addr, uint8_t key_state) { - if (key_addr == KeyAddr{0, 0} && key_state == 0) { - handleKeyswitchEvent(Key_X, key_addr, IS_PRESSED | WAS_PRESSED); + // handleKeyswitchEvent() is going to mask the underlying issue if it recurs, + // but leaving this here is better than nothing. + EventHandlerResult onKeyswitchEvent(KeyEvent &event) { + if (event.addr == KeyAddr{0, 0} && event.state == 0) { + event.key = Key_X; + event.state = IS_PRESSED; } return EventHandlerResult::OK; }