Reuse the button bit for WARP_END

WARP + Button makes no sense together, so reuse the _BUTTON bit for _WARP_END.
This will allow us to use the free'd up bit for something else.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/365/head
Gergely Nagy 8 years ago
parent 3d0903af41
commit dbbc80190a

@ -57,7 +57,7 @@ Key MouseKeys_::eventHandlerHook(Key mappedKey, byte row, byte col, uint8_t keyS
if (mappedKey.flags != (SYNTHETIC | IS_MOUSE_KEY)) if (mappedKey.flags != (SYNTHETIC | IS_MOUSE_KEY))
return mappedKey; return mappedKey;
if (mappedKey.keyCode & KEY_MOUSE_BUTTON) { if (mappedKey.keyCode & KEY_MOUSE_BUTTON && !(mappedKey.keyCode & KEY_MOUSE_WARP)) {
uint8_t button = mappedKey.keyCode & ~KEY_MOUSE_BUTTON; uint8_t button = mappedKey.keyCode & ~KEY_MOUSE_BUTTON;
if (key_toggled_on(keyState)) { if (key_toggled_on(keyState)) {

@ -14,7 +14,7 @@
#define KEY_MOUSE_RIGHT B0001000 #define KEY_MOUSE_RIGHT B0001000
#define KEY_MOUSE_BUTTON B0010000 #define KEY_MOUSE_BUTTON B0010000
#define KEY_MOUSE_WARP B0100000 #define KEY_MOUSE_WARP B0100000
#define KEY_MOUSE_WARP_END B1000000 #define KEY_MOUSE_WARP_END B0010000
#define Key_mouseWarpNW (Key) { KEY_MOUSE_WARP| KEY_MOUSE_UP | KEY_MOUSE_LEFT, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY } #define Key_mouseWarpNW (Key) { KEY_MOUSE_WARP| KEY_MOUSE_UP | KEY_MOUSE_LEFT, KEY_FLAGS|SYNTHETIC|IS_MOUSE_KEY }

Loading…
Cancel
Save