From 75fe7904b60552ed665e04a01d9c502a248a4816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 9 Apr 2018 13:09:41 +0200 Subject: [PATCH] Fix scroll events after the slow mouse fix. --- lib/KSDK_2.0_MK22FN512xxx12 | 2 +- right/src/usb_report_updater.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/KSDK_2.0_MK22FN512xxx12 b/lib/KSDK_2.0_MK22FN512xxx12 index 16e8071..9fbf2bb 160000 --- a/lib/KSDK_2.0_MK22FN512xxx12 +++ b/lib/KSDK_2.0_MK22FN512xxx12 @@ -1 +1 @@ -Subproject commit 16e8071ca10cb51de11806ee3b368b29fb14fd84 +Subproject commit 9fbf2bbf085a065a96fb6b2db11d03c3112bf7ba diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 6eaced1..df33541 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -378,12 +378,16 @@ void UpdateUsbReports(void) UsbReportUpdateCounter++; // Process the key inputs at a constant rate when moving the mouse, so the mouse speed is consistent - if (activeMouseStates[SerializedMouseAction_MoveUp] || - activeMouseStates[SerializedMouseAction_MoveDown] || - activeMouseStates[SerializedMouseAction_MoveLeft] || - activeMouseStates[SerializedMouseAction_MoveRight]) { - if (Timer_GetElapsedTime(&lastMouseUpdateTime) < USB_MOUSE_INTERRUPT_IN_INTERVAL) + bool hasActiveMouseState = false; + for (uint8_t i=0; i