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:
parent
8f7dc86223
commit
53a752f2d6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue