|
|
@ -3,11 +3,9 @@
|
|
|
|
static const Key keymaps[KEYMAPS][ROWS][COLS] PROGMEM = { KEYMAP_LIST };
|
|
|
|
static const Key keymaps[KEYMAPS][ROWS][COLS] PROGMEM = { KEYMAP_LIST };
|
|
|
|
|
|
|
|
|
|
|
|
void handle_synthetic_key_event(Key mappedKey, uint8_t currentState, uint8_t previousState) {
|
|
|
|
void handle_synthetic_key_event(Key mappedKey, uint8_t currentState, uint8_t previousState) {
|
|
|
|
if ( (mappedKey.flags == SYNTHETIC_KEY| IS_MOUSE_KEY )
|
|
|
|
if (mappedKey.flags & IS_MOUSE_KEY && !( mappedKey.rawKey & KEY_MOUSE_WARP) ) {
|
|
|
|
|
|
|
|
|
|
|
|
&& !( mappedKey.rawKey & KEY_MOUSE_WARP) ) {
|
|
|
|
|
|
|
|
handle_mouse_key_event(mappedKey, currentState, previousState);
|
|
|
|
handle_mouse_key_event(mappedKey, currentState, previousState);
|
|
|
|
} else if (! (mappedKey.flags == SYNTHETIC_KEY| IS_INTERNAL)
|
|
|
|
} else if (! (mappedKey.flags & IS_INTERNAL)
|
|
|
|
&& (mappedKey.rawKey == KEY_MOUSE_BTN_L
|
|
|
|
&& (mappedKey.rawKey == KEY_MOUSE_BTN_L
|
|
|
|
|| mappedKey.rawKey == KEY_MOUSE_BTN_M
|
|
|
|
|| mappedKey.rawKey == KEY_MOUSE_BTN_M
|
|
|
|
|| mappedKey.rawKey == KEY_MOUSE_BTN_R)) {
|
|
|
|
|| mappedKey.rawKey == KEY_MOUSE_BTN_R)) {
|
|
|
@ -20,22 +18,21 @@ void handle_synthetic_key_event(Key mappedKey, uint8_t currentState, uint8_t pre
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if (key_toggled_on(currentState,previousState)) {
|
|
|
|
else if (key_toggled_on(currentState,previousState)) {
|
|
|
|
if ( (mappedKey.flags == SYNTHETIC_KEY| IS_MOUSE_KEY)
|
|
|
|
if (mappedKey.rawKey & KEY_MOUSE_WARP && mappedKey.flags & IS_MOUSE_KEY) {
|
|
|
|
&& mappedKey.rawKey & KEY_MOUSE_WARP ) {
|
|
|
|
|
|
|
|
// we don't pass in the left and up values because those are the
|
|
|
|
// we don't pass in the left and up values because those are the
|
|
|
|
// default, "no-op" conditionals
|
|
|
|
// default, "no-op" conditionals
|
|
|
|
MouseWrapper.warp( ((mappedKey.rawKey & KEY_MOUSE_WARP_END) ? WARP_END : 0x00) |
|
|
|
|
MouseWrapper.warp( ((mappedKey.rawKey & KEY_MOUSE_WARP_END) ? WARP_END : 0x00) |
|
|
|
|
((mappedKey.rawKey & KEY_MOUSE_DOWN) ? WARP_DOWN : 0x00) |
|
|
|
|
((mappedKey.rawKey & KEY_MOUSE_DOWN) ? WARP_DOWN : 0x00) |
|
|
|
|
((mappedKey.rawKey & KEY_MOUSE_RIGHT) ? WARP_RIGHT : 0x00) );
|
|
|
|
((mappedKey.rawKey & KEY_MOUSE_RIGHT) ? WARP_RIGHT : 0x00) );
|
|
|
|
} else if (mappedKey.flags == SYNTHETIC_KEY| IS_CONSUMER) {
|
|
|
|
} else if (mappedKey.flags & IS_CONSUMER) {
|
|
|
|
ConsumerControl.press(mappedKey.rawKey);
|
|
|
|
ConsumerControl.press(mappedKey.rawKey);
|
|
|
|
} else if (mappedKey.flags == SYNTHETIC_KEY| IS_INTERNAL) {
|
|
|
|
} else if (mappedKey.flags & IS_INTERNAL) {
|
|
|
|
if (mappedKey.rawKey == LED_TOGGLE) {
|
|
|
|
if (mappedKey.rawKey == LED_TOGGLE) {
|
|
|
|
LEDControl.next_mode();
|
|
|
|
LEDControl.next_mode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (mappedKey.flags == SYNTHETIC_KEY| IS_SYSCTL) {
|
|
|
|
} else if (mappedKey.flags & IS_SYSCTL) {
|
|
|
|
SystemControl.press(mappedKey.rawKey);
|
|
|
|
SystemControl.press(mappedKey.rawKey);
|
|
|
|
} else if (mappedKey.flags == SYNTHETIC_KEY| IS_MACRO) {
|
|
|
|
} else if (mappedKey.flags & IS_MACRO) {
|
|
|
|
if (mappedKey.rawKey == 1) {
|
|
|
|
if (mappedKey.rawKey == 1) {
|
|
|
|
Serial.print("Keyboard.IO keyboard driver v0.00");
|
|
|
|
Serial.print("Keyboard.IO keyboard driver v0.00");
|
|
|
|
}
|
|
|
|
}
|
|
|
|