Scroll instead of moving the pointer with the blackberry trackball.

This commit is contained in:
László Monda
2019-06-13 14:54:41 +02:00
parent 262eb4a695
commit d9d8a91817

View File

@@ -169,22 +169,22 @@ static void processMouseActions()
MouseMoveState.xOut = 0;
MouseMoveState.yOut = 0;
for (uint8_t moduleId=0; moduleId<UHK_MODULE_MAX_COUNT; moduleId++) {
uhk_module_state_t *moduleState = UhkModuleStates + moduleId;
if (moduleState->pointerCount) {
ActiveUsbMouseReport->x += moduleState->pointerDelta.x;
ActiveUsbMouseReport->y += moduleState->pointerDelta.y;
moduleState->pointerDelta.x = 0;
moduleState->pointerDelta.y = 0;
}
}
processMouseKineticState(&MouseScrollState);
ActiveUsbMouseReport->wheelX = MouseScrollState.xOut;
ActiveUsbMouseReport->wheelY = MouseScrollState.yOut;
MouseScrollState.xOut = 0;
MouseScrollState.yOut = 0;
for (uint8_t moduleId=0; moduleId<UHK_MODULE_MAX_COUNT; moduleId++) {
uhk_module_state_t *moduleState = UhkModuleStates + moduleId;
if (moduleState->pointerCount) {
ActiveUsbMouseReport->wheelX += moduleState->pointerDelta.x;
ActiveUsbMouseReport->wheelY -= moduleState->pointerDelta.y;
moduleState->pointerDelta.x = 0;
moduleState->pointerDelta.y = 0;
}
}
// The following line makes the firmware crash for some reason:
// SetDebugBufferFloat(60, mouseScrollState.currentSpeed);
// TODO: Figure out why.