Make opposing mouse movement keys cancel each other

Instead of having `Key_mouseL` & `Key_mouseUp` override `Key_mouseR` &
`Key_mouseDn`, respectively, stop mouse movement on a given axis when both keys
are held simultaneously. Doing so will not reset acceleration, so when one of
them is released, the mouse will resume movement at full speed immediately.

Closes #634.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/640/head
Michael Richters 6 years ago committed by Jesse Vincent
parent 103e8ba859
commit 6805b349e1

@ -90,14 +90,14 @@ EventHandlerResult MouseKeys_::beforeReportingState() {
}
if (mouseMoveIntent & KEY_MOUSE_UP)
moveY = -speed;
else if (mouseMoveIntent & KEY_MOUSE_DOWN)
moveY = speed;
moveY -= speed;
if (mouseMoveIntent & KEY_MOUSE_DOWN)
moveY += speed;
if (mouseMoveIntent & KEY_MOUSE_LEFT)
moveX = -speed;
else if (mouseMoveIntent & KEY_MOUSE_RIGHT)
moveX = speed;
moveX -= speed;
if (mouseMoveIntent & KEY_MOUSE_RIGHT)
moveX += speed;
MouseWrapper.move(moveX, moveY);

Loading…
Cancel
Save