starting to move keymap dependencies from mouse control

pull/18/head
Jesse Vincent 9 years ago
parent d667d159c2
commit d027b2c40d

@ -7,7 +7,7 @@ void handle_synthetic_key_event(byte switchState, Key mappedKey) {
if (mappedKey.flags & IS_MOUSE_KEY ) {
if (mappedKey.rawKey & MOUSE_WARP) {
if (key_toggled_on(switchState)) {
warp_mouse(mappedKey);
warp_mouse(mappedKey.rawKey);
}
} else {
handle_mouse_key_event(switchState, mappedKey);

@ -42,13 +42,13 @@ void end_warping() {
is_warping= false;
}
void warp_mouse(Key quadrant) {
void warp_mouse(uint8_t quadrant) {
if (is_warping == false) {
begin_warping();
}
if ( quadrant.rawKey & MOUSE_END_WARP) {
if ( quadrant & MOUSE_END_WARP) {
end_warping();
return;
}
@ -57,16 +57,16 @@ void warp_mouse(Key quadrant) {
next_width = next_width / 2;
next_height = next_height/2;
if (quadrant.rawKey & MOUSE_UP) {
if (quadrant & MOUSE_UP) {
// Serial.print(" - up ");
} else if (quadrant.rawKey & MOUSE_DN) {
} else if (quadrant & MOUSE_DN) {
// Serial.print(" - down ");
section_top = section_top + next_height;
}
if (quadrant.rawKey & MOUSE_L) {
if (quadrant & MOUSE_L) {
// Serial.print(" - left ");
} else if (quadrant.rawKey & MOUSE_R) {
} else if (quadrant & MOUSE_R) {
// Serial.print(" - right ");
section_left = section_left + next_width;
}

@ -5,13 +5,14 @@
#include "key_defs.h"
#include "matrix_state.h"
#include "HID-Project.h"
// Mouse-related 'public' API methods
double mouse_accel (double cycles);
void move_mouse( int8_t x, int8_t y);
void begin_warping();
void end_warping();
void warp_mouse(Key key);
void warp_mouse(uint8_t quadrant);

Loading…
Cancel
Save