Fix scroll events after the slow mouse fix.
This commit is contained in:
Submodule lib/KSDK_2.0_MK22FN512xxx12 updated: 16e8071ca1...9fbf2bbf08
@@ -378,12 +378,16 @@ void UpdateUsbReports(void)
|
|||||||
UsbReportUpdateCounter++;
|
UsbReportUpdateCounter++;
|
||||||
|
|
||||||
// Process the key inputs at a constant rate when moving the mouse, so the mouse speed is consistent
|
// Process the key inputs at a constant rate when moving the mouse, so the mouse speed is consistent
|
||||||
if (activeMouseStates[SerializedMouseAction_MoveUp] ||
|
bool hasActiveMouseState = false;
|
||||||
activeMouseStates[SerializedMouseAction_MoveDown] ||
|
for (uint8_t i=0; i<ACTIVE_MOUSE_STATES_COUNT; i++) {
|
||||||
activeMouseStates[SerializedMouseAction_MoveLeft] ||
|
hasActiveMouseState = true;
|
||||||
activeMouseStates[SerializedMouseAction_MoveRight]) {
|
break;
|
||||||
if (Timer_GetElapsedTime(&lastMouseUpdateTime) < USB_MOUSE_INTERRUPT_IN_INTERVAL)
|
}
|
||||||
|
|
||||||
|
if (hasActiveMouseState) {
|
||||||
|
if (Timer_GetElapsedTime(&lastMouseUpdateTime) < USB_MOUSE_INTERRUPT_IN_INTERVAL) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
Timer_SetCurrentTime(&lastMouseUpdateTime);
|
Timer_SetCurrentTime(&lastMouseUpdateTime);
|
||||||
} else if (!IsUsbBasicKeyboardReportSent || !IsUsbMediaKeyboardReportSent || !IsUsbSystemKeyboardReportSent || !IsUsbMouseReportSent) {
|
} else if (!IsUsbBasicKeyboardReportSent || !IsUsbMediaKeyboardReportSent || !IsUsbSystemKeyboardReportSent || !IsUsbMouseReportSent) {
|
||||||
return;
|
return;
|
||||||
@@ -424,6 +428,7 @@ void UpdateUsbReports(void)
|
|||||||
IsUsbMouseReportSent = false;
|
IsUsbMouseReportSent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((previousLayer != LayerId_Base || !IsUsbBasicKeyboardReportSent || !IsUsbMediaKeyboardReportSent || !IsUsbSystemKeyboardReportSent || !IsUsbMouseReportSent) && IsComputerSleeping())
|
if ((previousLayer != LayerId_Base || !IsUsbBasicKeyboardReportSent || !IsUsbMediaKeyboardReportSent || !IsUsbSystemKeyboardReportSent || !IsUsbMouseReportSent) && IsComputerSleeping()) {
|
||||||
WakeupComputer(true); // Wake up the computer if any key is pressed and the computer is sleeping
|
WakeupComputer(true); // Wake up the computer if any key is pressed and the computer is sleeping
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user