Eliminate unnecessary `sendKeyboardReport`

It seems that if we inject the release of the mapped modifier key before injecting the press of the alternate key, we avoid the need to call `hid::sendKeyboardReport`, which in turn fixes #7. Which is nice.

Closes #7
pull/389/head
Piers Cawley 7 years ago committed by Ben Gemperline
parent 526a583620
commit 6dcb15474e

@ -163,8 +163,8 @@ Key SpaceCadet::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key
//may want to even UNSET the originally pressed key (future
//enhanacement?). This might also mean we don't need to return the
//key that was pressed, though I haven't confirmed that.
handleKeyswitchEvent(mapped_key, row, col, INJECTED);
handleKeyswitchEvent(alternate_key, row, col, IS_PRESSED | INJECTED);
hid::sendKeyboardReport();
//Unflag the key so we don't try this again.
map[index].flagged = false;

Loading…
Cancel
Save