1
0

Fix anyKeyMacro for new hid API

Signed-off-by: Anders Hustvedt <anders@computerfire.net>
This commit is contained in:
Anders Hustvedt 2018-10-29 06:09:15 -06:00
parent a963b8074e
commit ab57ab8468

View File

@ -291,11 +291,14 @@ static void versionInfoMacro(uint8_t keyState) {
static void anyKeyMacro(uint8_t keyState) { static void anyKeyMacro(uint8_t keyState) {
static Key lastKey; static Key lastKey;
if (keyToggledOn(keyState)) bool toggledOn = false;
if (keyToggledOn(keyState)) {
lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36); lastKey.keyCode = Key_A.keyCode + (uint8_t)(millis() % 36);
toggledOn = true;
}
if (keyIsPressed(keyState)) if (keyIsPressed(keyState))
kaleidoscope::hid::pressKey(lastKey); kaleidoscope::hid::pressKey(lastKey, toggledOn);
} }