From ba383a18ade15a2ce6c7eff9c87fc898ab5d52cb Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 6 Apr 2021 18:53:10 -0500 Subject: [PATCH] Adapt DynamicTapDance plugin to KeyEvent handlers Signed-off-by: Michael Richters --- .../src/kaleidoscope/plugin/DynamicTapDance.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp index ef2702e1..27ecd3c9 100644 --- a/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp +++ b/plugins/Kaleidoscope-DynamicTapDance/src/kaleidoscope/plugin/DynamicTapDance.cpp @@ -19,6 +19,8 @@ #include #include "Kaleidoscope-FocusSerial.h" +#include "kaleidoscope/Runtime.h" +#include "kaleidoscope/KeyEvent.h" namespace kaleidoscope { namespace plugin { @@ -72,14 +74,14 @@ bool DynamicTapDance::dance(uint8_t tap_dance_index, KeyAddr key_addr, break; case TapDance::Interrupt: case TapDance::Timeout: - handleKeyswitchEvent(key, key_addr, IS_PRESSED | INJECTED); + Runtime.handleKeyEvent(KeyEvent(key_addr, IS_PRESSED, key)); break; case TapDance::Hold: - handleKeyswitchEvent(key, key_addr, IS_PRESSED | WAS_PRESSED | INJECTED); + Runtime.handleKeyEvent(KeyEvent(key_addr, IS_PRESSED | WAS_PRESSED, key)); break; case TapDance::Release: - kaleidoscope::Runtime.hid().keyboard().sendReport(); - handleKeyswitchEvent(key, key_addr, WAS_PRESSED | INJECTED); + //kaleidoscope::Runtime.hid().keyboard().sendReport(); + Runtime.handleKeyEvent(KeyEvent(key_addr, WAS_PRESSED, key)); break; }