Standardize mouse movement constants to LEFT RIGHT and DOWN rather than L R and DN. (UP was already ok)

pull/18/head
Jesse Vincent 9 years ago
parent 4d4681be2c
commit 451b133e3a

@ -32,9 +32,9 @@ typedef struct {
#define MOUSE_UP B0000001 #define MOUSE_UP B0000001
#define MOUSE_DN B0000010 #define MOUSE_DOWN B0000010
#define MOUSE_L B0000100 #define MOUSE_LEFT B0000100
#define MOUSE_R B0001000 #define MOUSE_RIGHT B0001000
#define MOUSE_CENTER B0010000 #define MOUSE_CENTER B0010000
#define MOUSE_WARP B0100000 #define MOUSE_WARP B0100000
#define MOUSE_WARP_END B1000000 #define MOUSE_WARP_END B1000000
@ -60,22 +60,22 @@ typedef struct {
#define Key_macroKey1 (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MACRO, 1} #define Key_macroKey1 (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MACRO, 1}
#define Key_mouseWarpNW (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_UP | MOUSE_L } #define Key_mouseWarpNW (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_UP | MOUSE_LEFT }
#define Key_mouseWarpNE (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_UP | MOUSE_R } #define Key_mouseWarpNE (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_UP | MOUSE_RIGHT }
#define Key_mouseWarpSW (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_DN | MOUSE_L } #define Key_mouseWarpSW (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_DOWN | MOUSE_LEFT }
#define Key_mouseWarpSE (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_DN | MOUSE_R } #define Key_mouseWarpSE (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_DOWN | MOUSE_RIGHT }
#define Key_mouseWarpEnd (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_WARP_END} #define Key_mouseWarpEnd (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_WARP| MOUSE_WARP_END}
#define Key_mouseUpL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP | MOUSE_L } #define Key_mouseUpL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP | MOUSE_LEFT }
#define Key_mouseUp (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP } #define Key_mouseUp (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP }
#define Key_mouseUpR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP | MOUSE_R } #define Key_mouseUpR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_UP | MOUSE_RIGHT }
#define Key_mouseL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_L } #define Key_mouseL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_LEFT }
#define Key_mouseR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_R } #define Key_mouseR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_RIGHT }
#define Key_mouseDnL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DN | MOUSE_L } #define Key_mouseDnL (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DOWN | MOUSE_LEFT }
#define Key_mouseDn (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DN } #define Key_mouseDn (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DOWN }
#define Key_mouseDnR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DN | MOUSE_R } #define Key_mouseDnR (Key){ KEY_FLAGS|SYNTHETIC_KEY|IS_MOUSE_KEY, MOUSE_DOWN | MOUSE_RIGHT }
#define Key_mouseScrollUp #define Key_mouseScrollUp
#define Key_mouseScrollDn #define Key_mouseScrollDn
#define Key_mouseScrollL #define Key_mouseScrollL

@ -10,8 +10,8 @@ void handle_synthetic_key_event(byte switchState, Key mappedKey) {
// 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
warp_mouse( (mappedKey.rawKey & MOUSE_WARP_END ? WARP_END : 0x00) | warp_mouse( (mappedKey.rawKey & MOUSE_WARP_END ? WARP_END : 0x00) |
(mappedKey.rawKey & MOUSE_DN ? WARP_DOWN : 0x00) | (mappedKey.rawKey & MOUSE_DOWN ? WARP_DOWN : 0x00) |
(mappedKey.rawKey & MOUSE_R ? WARP_RIGHT : 0x00) ); (mappedKey.rawKey & MOUSE_RIGHT ? WARP_RIGHT : 0x00) );
} }
} else { } else {
handle_mouse_key_event(switchState, mappedKey); handle_mouse_key_event(switchState, mappedKey);
@ -116,13 +116,13 @@ void handle_mouse_key_event(byte switchState, Key mappedKey) {
if (mappedKey.rawKey & MOUSE_UP) { if (mappedKey.rawKey & MOUSE_UP) {
move_mouse(0,-1); move_mouse(0,-1);
} }
if (mappedKey.rawKey & MOUSE_DN) { if (mappedKey.rawKey & MOUSE_DOWN) {
move_mouse(0,1); move_mouse(0,1);
} }
if (mappedKey.rawKey & MOUSE_L) { if (mappedKey.rawKey & MOUSE_LEFT) {
move_mouse(-1,0); move_mouse(-1,0);
} }
if (mappedKey.rawKey & MOUSE_R) { if (mappedKey.rawKey & MOUSE_RIGHT) {
move_mouse(1,0); move_mouse(1,0);
} }
} }

Loading…
Cancel
Save