port to new hid facade

pull/389/head
Jesse Vincent 7 years ago
parent 0235d41ae0
commit 6b6cbd4803
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -27,6 +27,7 @@ will handle the symbol actions:
#include <Kaleidoscope.h> #include <Kaleidoscope.h>
#include <Kaleidoscope-Syster.h> #include <Kaleidoscope-Syster.h>
#include <Kaleidoscope-Unicode.h> #include <Kaleidoscope-Unicode.h>
#include <kaleidoscope/hid.h>
void systerAction(kaleidoscope::Syster::action_t action, const char *symbol) { void systerAction(kaleidoscope::Syster::action_t action, const char *symbol) {
switch (action) { switch (action) {
@ -35,9 +36,9 @@ void systerAction(kaleidoscope::Syster::action_t action, const char *symbol) {
break; break;
case kaleidoscope::Syster::EndAction: case kaleidoscope::Syster::EndAction:
handleKeyswitchEvent (Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED); handleKeyswitchEvent (Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED);
Keyboard.sendReport (); kaleidoscope::hid::sendKeyboardReport ();
handleKeyswitchEvent (Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED); handleKeyswitchEvent (Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED);
Keyboard.sendReport (); kaleidoscope::hid::sendKeyboardReport ();
break; break;
case kaleidoscope::Syster::SymbolAction: case kaleidoscope::Syster::SymbolAction:
Serial.print ("systerAction: symbol="); Serial.print ("systerAction: symbol=");

@ -21,6 +21,7 @@
#include <Kaleidoscope/HostOS-select.h> #include <Kaleidoscope/HostOS-select.h>
#include <Kaleidoscope-Syster.h> #include <Kaleidoscope-Syster.h>
#include <Kaleidoscope-Unicode.h> #include <Kaleidoscope-Unicode.h>
#include <kaleidoscope/hid.h>
const Key keymaps[][ROWS][COLS] PROGMEM = { const Key keymaps[][ROWS][COLS] PROGMEM = {
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
@ -49,9 +50,9 @@ void systerAction(kaleidoscope::Syster::action_t action, const char *symbol) {
break; break;
case kaleidoscope::Syster::EndAction: case kaleidoscope::Syster::EndAction:
handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED); handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED);
Keyboard.sendReport(); kaleidoscope::hid::sendKeyboardReport();
handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED); handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED);
Keyboard.sendReport(); kaleidoscope::hid::sendKeyboardReport();
break; break;
case kaleidoscope::Syster::SymbolAction: case kaleidoscope::Syster::SymbolAction:
Serial.print("systerAction: symbol="); Serial.print("systerAction: symbol=");

@ -17,6 +17,7 @@
*/ */
#include <Kaleidoscope-Syster.h> #include <Kaleidoscope-Syster.h>
#include <kaleidoscope/hid.h>
#undef SYSTER #undef SYSTER
@ -71,9 +72,9 @@ Key Syster::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_sta
if (mapped_key == Key_Spacebar) { if (mapped_key == Key_Spacebar) {
for (uint8_t i = 0; i <= symbol_pos_; i++) { for (uint8_t i = 0; i <= symbol_pos_; i++) {
handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED); handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, IS_PRESSED | INJECTED);
Keyboard.sendReport(); hid::sendKeyboardReport();
handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED); handleKeyswitchEvent(Key_Backspace, UNKNOWN_KEYSWITCH_LOCATION, WAS_PRESSED | INJECTED);
Keyboard.sendReport(); hid::sendKeyboardReport();
} }
systerAction(EndAction, NULL); systerAction(EndAction, NULL);

Loading…
Cancel
Save