Add support for the Shortcut, too

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/365/head
Gergely Nagy 8 years ago
parent 35918a91a0
commit 7a2804250c

@ -18,6 +18,16 @@
#include <Akela-MagicCombo.h> #include <Akela-MagicCombo.h>
#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 { namespace Akela {
const MagicCombo::dictionary_t *MagicCombo::dictionary; const MagicCombo::dictionary_t *MagicCombo::dictionary;
@ -51,8 +61,8 @@ namespace Akela {
if (combo.leftHand == 0 && combo.rightHand == 0) if (combo.leftHand == 0 && combo.rightHand == 0)
break; break;
if (KeyboardHardware.leftHandState.all == combo.leftHand && if (LEFTHANDSTATE.all == combo.leftHand &&
KeyboardHardware.rightHandState.all == combo.rightHand) { RIGHTHANDSTATE.all == combo.rightHand) {
if (startTime == 0 || minInterval == 0 || ((millis () - startTime) >= minInterval)) { if (startTime == 0 || minInterval == 0 || ((millis () - startTime) >= minInterval)) {
magicComboActions (i, combo.leftHand, combo.rightHand); magicComboActions (i, combo.leftHand, combo.rightHand);
startTime = millis (); startTime = millis ();

Loading…
Cancel
Save