From de97e9a2f4485c1bfd208fdb3ce85334b04ddaf1 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 25 Jul 2017 15:14:07 -0700 Subject: Fix key repeat on Any. Port to new hid facade api --- Model01-Firmware.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino index 6111088..1b15ace 100644 --- a/Model01-Firmware.ino +++ b/Model01-Firmware.ino @@ -101,9 +101,13 @@ const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { } else if (macroIndex == 1 && keyToggledOn(keyState)) { Macros.type(PSTR("Keyboardio Model 01 - Kaleidoscope ")); Macros.type(PSTR(BUILD_INFORMATION)); - } else if (macroIndex == MACRO_ANY && keyToggledOn(keyState)) { - Keyboard.press(Key_A.keyCode + (uint8_t)(millis() % 36)); - Keyboard.sendReport(); + } else if (macroIndex == MACRO_ANY) { + static Key lastKey; + if (keyToggledOn(keyState)) + lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36); + + if (keyIsPressed(keyState)) + kaleidoscope::hid::pressKey(lastKey); } return MACRO_NONE; } -- cgit v1.2.3