From b18465033ebfe9eda2900960490e8c84cfdccc2b Mon Sep 17 00:00:00 2001 From: Ryan Anderson Date: Mon, 23 Apr 2018 11:33:33 +0100 Subject: [PATCH] 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. --- src/Kaleidoscope-MouseKeys.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Kaleidoscope-MouseKeys.cpp b/src/Kaleidoscope-MouseKeys.cpp index 6da6090b..859dc669 100644 --- a/src/Kaleidoscope-MouseKeys.cpp +++ b/src/Kaleidoscope-MouseKeys.cpp @@ -62,8 +62,10 @@ void MouseKeys_::loopHook(bool postClear) { int8_t moveX = 0, moveY = 0; if (millis() >= accelEndTime) { - if (MouseWrapper.accelStep < 255 - accelSpeed) + if (MouseWrapper.accelStep < 255 - accelSpeed) { MouseWrapper.accelStep += accelSpeed; + } + accelEndTime = millis() + accelDelay; } if (mouseMoveIntent & KEY_MOUSE_UP)