1
0

Merge pull request #68 from hustvedt/fix-any

Fix anyKeyMacro for new hid API
This commit is contained in:
Gergely Nagy 2018-10-30 07:03:06 +01:00 committed by GitHub
commit ab471273bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
} }