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,8 +62,10 @@ 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)

Loading…
Cancel
Save