This commit is contained in:
Laserlicht
2023-09-18 16:43:16 +02:00
committed by GitHub
parent 7321bb1d25
commit 71659f1423
+4 -4
View File
@@ -181,15 +181,15 @@ void InputSourceTouch::handleEventFingerUp(const SDL_TouchFingerEvent & tfinger)
case TouchState::TAP_DOWN_SHORT:
{
GH.input().setCursorPosition(convertTouchToMouse(tfinger));
if(tfinger.timestamp - lastLeftClickTimeTicks < doubleTouchTimeMilliseconds && (convertTouchToMouse(tfinger) - lastLeftClickPosition).distance < doubleTouchToleranceDistance)
GH.events().dispatchMouseDoubleClick(convertTouchToMouse(tfinger);
if(tfinger.timestamp - lastLeftClickTimeTicks < params.doubleTouchTimeMilliseconds && (convertTouchToMouse(tfinger) - lastLeftClickPosition).length() < params.doubleTouchToleranceDistance)
GH.events().dispatchMouseDoubleClick(convertTouchToMouse(tfinger));
else
{
GH.events().dispatchMouseLeftButtonPressed(convertTouchToMouse(tfinger), params.touchToleranceDistance);
GH.events().dispatchMouseLeftButtonReleased(convertTouchToMouse(tfinger), params.touchToleranceDistance);
lastLeftClickTimeTicks = tfinger.timestamp;
lastLeftClickPosition = convertTouchToMouse(tfinger);
}
lastLeftClickTimeTicks = tfinger.timestamp;
lastLeftClickPosition = convertTouchToMouse(tfinger);
state = TouchState::IDLE;
break;
}