summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Vincent <jesse@keyboard.io>2017-07-25 15:14:07 -0700
committerJesse Vincent <jesse@keyboard.io>2017-07-25 15:14:07 -0700
commitde97e9a2f4485c1bfd208fdb3ce85334b04ddaf1 (patch)
tree21e18043ed00d118582b5b5eba2905893053f00b
parentddc4e15fbf5b7f3f1216871c8adb37a9418d4e94 (diff)
downloadmodel01-firmware-de97e9a2f4485c1bfd208fdb3ce85334b04ddaf1.tar.gz
model01-firmware-de97e9a2f4485c1bfd208fdb3ce85334b04ddaf1.tar.bz2
model01-firmware-de97e9a2f4485c1bfd208fdb3ce85334b04ddaf1.zip
Fix key repeat on Any. Port to new hid facade api
-rw-r--r--Model01-Firmware.ino10
1 files 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;
}