Port to new hid facade

pull/389/head
Jesse Vincent 7 years ago
parent bb72deed23
commit 93e83ed75a
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -17,6 +17,7 @@
*/ */
#include <Kaleidoscope-TopsyTurvy.h> #include <Kaleidoscope-TopsyTurvy.h>
#include "kaleidoscope/hid.h"
#define TOPSYTURVY 0b01000000 #define TOPSYTURVY 0b01000000
@ -62,22 +63,22 @@ Key TopsyTurvy::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key
if (!mod_state_) { if (!mod_state_) {
if (keyIsPressed(key_state)) if (keyIsPressed(key_state))
Keyboard.press(Key_LeftShift.keyCode); hid::pressRawKey(Key_LeftShift);
handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED); handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED);
Keyboard.sendReport(); hid::sendKeyboardReport();
if (keyToggledOff(key_state)) if (keyToggledOff(key_state))
Keyboard.release(Key_LeftShift.keyCode); hid::releaseRawKey(Key_LeftShift);
} else { } else {
Keyboard.release(Key_LeftShift.keyCode); hid::releaseRawKey(Key_LeftShift);
Keyboard.release(Key_RightShift.keyCode); hid::releaseRawKey(Key_RightShift);
Keyboard.sendReport(); hid::sendKeyboardReport();
handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED); handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED);
Keyboard.sendReport(); hid::sendKeyboardReport();
if (bitRead(mod_state_, 0)) if (bitRead(mod_state_, 0))
Keyboard.press(Key_LeftShift.keyCode); hid::pressRawKey(Key_LeftShift);
if (bitRead(mod_state_, 1)) if (bitRead(mod_state_, 1))
Keyboard.press(Key_RightShift.keyCode); hid::pressRawKey(Key_RightShift);
} }
return Key_NoKey; return Key_NoKey;

Loading…
Cancel
Save