From 7a2804250cea4490631c926f91331af2bdac07cd Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 10 Feb 2017 13:05:58 +0100 Subject: [PATCH] Add support for the Shortcut, too Signed-off-by: Gergely Nagy --- src/Akela/MagicCombo.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Akela/MagicCombo.cpp b/src/Akela/MagicCombo.cpp index 01da07d2..c5cf8541 100644 --- a/src/Akela/MagicCombo.cpp +++ b/src/Akela/MagicCombo.cpp @@ -18,6 +18,16 @@ #include +#if defined(ARDUINO_AVR_MODEL01) +#define LEFTHANDSTATE KeyboardHardware.leftHandState +#define RIGHTHANDSTATE KeyboardHardware.rightHandState +#endif + +#if defined(ARDUINO_AVR_SHORTCUT) +#define LEFTHANDSTATE KeyboardHardware.scanner.leftHandState +#define RIGHTHANDSTATE KeyboardHardware.scanner.rightHandState +#endif + namespace Akela { const MagicCombo::dictionary_t *MagicCombo::dictionary; @@ -51,8 +61,8 @@ namespace Akela { if (combo.leftHand == 0 && combo.rightHand == 0) break; - if (KeyboardHardware.leftHandState.all == combo.leftHand && - KeyboardHardware.rightHandState.all == combo.rightHand) { + if (LEFTHANDSTATE.all == combo.leftHand && + RIGHTHANDSTATE.all == combo.rightHand) { if (startTime == 0 || minInterval == 0 || ((millis () - startTime) >= minInterval)) { magicComboActions (i, combo.leftHand, combo.rightHand); startTime = millis ();