From 93e83ed75a83eeba261cf06f8ff5aac2c155df40 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 25 Jul 2017 13:20:54 -0700 Subject: [PATCH] Port to new hid facade --- src/Kaleidoscope/TopsyTurvy.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Kaleidoscope/TopsyTurvy.cpp b/src/Kaleidoscope/TopsyTurvy.cpp index e473696c..475e9960 100644 --- a/src/Kaleidoscope/TopsyTurvy.cpp +++ b/src/Kaleidoscope/TopsyTurvy.cpp @@ -17,6 +17,7 @@ */ #include +#include "kaleidoscope/hid.h" #define TOPSYTURVY 0b01000000 @@ -62,22 +63,22 @@ Key TopsyTurvy::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key if (!mod_state_) { if (keyIsPressed(key_state)) - Keyboard.press(Key_LeftShift.keyCode); + hid::pressRawKey(Key_LeftShift); handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED); - Keyboard.sendReport(); + hid::sendKeyboardReport(); if (keyToggledOff(key_state)) - Keyboard.release(Key_LeftShift.keyCode); + hid::releaseRawKey(Key_LeftShift); } else { - Keyboard.release(Key_LeftShift.keyCode); - Keyboard.release(Key_RightShift.keyCode); - Keyboard.sendReport(); + hid::releaseRawKey(Key_LeftShift); + hid::releaseRawKey(Key_RightShift); + hid::sendKeyboardReport(); handleKeyswitchEvent(new_key, row, col, key_state | TOPSYTURVY | INJECTED); - Keyboard.sendReport(); + hid::sendKeyboardReport(); if (bitRead(mod_state_, 0)) - Keyboard.press(Key_LeftShift.keyCode); + hid::pressRawKey(Key_LeftShift); if (bitRead(mod_state_, 1)) - Keyboard.press(Key_RightShift.keyCode); + hid::pressRawKey(Key_RightShift); } return Key_NoKey;