Update to 'new' keyswitch state API

pull/365/head
Jesse Vincent 8 years ago
parent 0808057864
commit 2d7388e42f
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -76,25 +76,25 @@ Key MouseKeys_::eventHandlerHook(Key mappedKey, byte row, byte col, uint8_t keyS
if (mappedKey.keyCode & KEY_MOUSE_BUTTON && !(mappedKey.keyCode & KEY_MOUSE_WARP)) { 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 (keyToggledOn(keyState)) {
MouseWrapper.press_button(button); MouseWrapper.press_button(button);
} else if (key_toggled_off(keyState)) { } else if (keyToggledOff(keyState)) {
MouseWrapper.release_button(button); MouseWrapper.release_button(button);
} }
} else if (!(mappedKey.keyCode & KEY_MOUSE_WARP)) { } else if (!(mappedKey.keyCode & KEY_MOUSE_WARP)) {
if (key_toggled_on(keyState)) { if (keyToggledOn(keyState)) {
endTime = millis() + speedDelay; endTime = millis() + speedDelay;
accelEndTime = millis() + accelDelay; accelEndTime = millis() + accelDelay;
wheelEndTime = 0; wheelEndTime = 0;
} }
if (key_is_pressed(keyState)) { if (keyIsPressed(keyState)) {
if (mappedKey.keyCode & KEY_MOUSE_WHEEL) { if (mappedKey.keyCode & KEY_MOUSE_WHEEL) {
scrollWheel(mappedKey.keyCode); scrollWheel(mappedKey.keyCode);
} else { } else {
mouseMoveIntent |= mappedKey.keyCode; mouseMoveIntent |= mappedKey.keyCode;
} }
} }
} else if (key_toggled_on(keyState)) { } else if (keyToggledOn(keyState)) {
if (mappedKey.keyCode & KEY_MOUSE_WARP && mappedKey.flags & IS_MOUSE_KEY) { if (mappedKey.keyCode & KEY_MOUSE_WARP && mappedKey.flags & IS_MOUSE_KEY) {
// 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

Loading…
Cancel
Save