You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Disable long press for mouse events
Long press is used to simulate right-click events for finger touch and stylus. The previous logic also caused it to trigger for mouse input, which is not needed since the user can instead use the mouse right click button. This update disables long press as right click events for mouse input.
This commit is contained in:
@@ -76,8 +76,11 @@ internal class GodotGestureHandler(private val inputHandler: GodotInputHandler)
|
||||
}
|
||||
|
||||
override fun onLongPress(event: MotionEvent) {
|
||||
val toolType = GodotInputHandler.getEventToolType(event)
|
||||
if (toolType != MotionEvent.TOOL_TYPE_MOUSE) {
|
||||
contextClickRouter(event)
|
||||
}
|
||||
}
|
||||
|
||||
private fun contextClickRouter(event: MotionEvent) {
|
||||
if (scaleInProgress || nextDownIsDoubleTap) {
|
||||
|
||||
@@ -472,7 +472,7 @@ public class GodotInputHandler implements InputManager.InputDeviceListener {
|
||||
return button;
|
||||
}
|
||||
|
||||
private static int getEventToolType(MotionEvent event) {
|
||||
static int getEventToolType(MotionEvent event) {
|
||||
return event.getPointerCount() > 0 ? event.getToolType(0) : MotionEvent.TOOL_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user