We'd broken LED toggling (non-mouse IS_INTERNAL keys)

pull/18/head
Jesse Vincent 9 years ago
parent fd10be9b0d
commit 637bb7652a

@ -28,7 +28,16 @@ typedef struct {
// IS_INTERNAL key table:
#define LED_TOGGLE 1
#define LED_TOGGLE 0x01 // Synthetic, internal
// Synthetic, not internal
#define KEY_MOUSE_BTN_L 0x01 // Synthetic key
#define KEY_MOUSE_BTN_M 0x04 // Synthetic key
#define KEY_MOUSE_BTN_R 0x02 // Synthetic key
#define KEY_MOUSE_UP B0000001
@ -80,9 +89,6 @@ typedef struct {
#define Key_mouseScrollDn
#define Key_mouseScrollL
#define Key_mouseScrollR
#define KEY_MOUSE_BTN_L 0x01 // Synthetic key
#define KEY_MOUSE_BTN_M 0x04 // Synthetic key
#define KEY_MOUSE_BTN_R 0x02 // Synthetic key
#define Key_mouseBtnL (Key){ KEY_FLAGS | SYNTHETIC_KEY, KEY_MOUSE_BTN_L }
#define Key_mouseBtnM (Key){ KEY_FLAGS | SYNTHETIC_KEY , KEY_MOUSE_BTN_M }
#define Key_mouseBtnR (Key){ KEY_FLAGS | SYNTHETIC_KEY, KEY_MOUSE_BTN_R }

@ -3,9 +3,10 @@
void handle_synthetic_key_event(byte switchState, Key mappedKey) {
if (mappedKey.flags & IS_MOUSE_KEY && !( mappedKey.rawKey & KEY_MOUSE_WARP) ) {
handle_mouse_key_event(switchState, mappedKey);
} else if (mappedKey.rawKey == KEY_MOUSE_BTN_L
} else if (! (mappedKey.flags & IS_INTERNAL)
&& (mappedKey.rawKey == KEY_MOUSE_BTN_L
|| mappedKey.rawKey == KEY_MOUSE_BTN_M
|| mappedKey.rawKey == KEY_MOUSE_BTN_R) {
|| mappedKey.rawKey == KEY_MOUSE_BTN_R)) {
if (key_toggled_on (switchState)) {
MouseWrapper.press_button(
(mappedKey.rawKey == KEY_MOUSE_BTN_L ? KEY_MOUSE_BUTTON_LEFT : 0x00) |

Loading…
Cancel
Save