Reset the acceleration timer each time it expires.

Without this, once the timeout expires the first time, every time
through the loop triggers acceleration, which rapidly becomes
excessive.
pull/365/head
Ryan Anderson 7 years ago
parent 7ddb61c65f
commit b18465033e

@ -62,9 +62,11 @@ void MouseKeys_::loopHook(bool postClear) {
int8_t moveX = 0, moveY = 0; int8_t moveX = 0, moveY = 0;
if (millis() >= accelEndTime) { if (millis() >= accelEndTime) {
if (MouseWrapper.accelStep < 255 - accelSpeed) if (MouseWrapper.accelStep < 255 - accelSpeed) {
MouseWrapper.accelStep += accelSpeed; MouseWrapper.accelStep += accelSpeed;
} }
accelEndTime = millis() + accelDelay;
}
if (mouseMoveIntent & KEY_MOUSE_UP) if (mouseMoveIntent & KEY_MOUSE_UP)
moveY = -speed; moveY = -speed;

Loading…
Cancel
Save