From 835c49da119e1a58990c6e283f08d4e60a74dee8 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Sat, 23 Jan 2021 22:26:33 +1030 Subject: [PATCH] Show mouse cursor when mouse used --- scripts/InputHandler.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/InputHandler.gd b/scripts/InputHandler.gd index 24ba2d1..e98b471 100644 --- a/scripts/InputHandler.gd +++ b/scripts/InputHandler.gd @@ -139,9 +139,11 @@ func _input(event): # Unfortunately event.device does NOT differentiate touchscreen inputs on X11, Godot v3.1.1 # As such, we'll need to do some fancy mapping for multiple inputs if (event is InputEventScreenDrag): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) touch_points[event.index] = {pressed = true, position = event.position} swipe_momentum = event.speed elif (event is InputEventScreenTouch): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) if event.pressed: if not touch_points.has(event.index): touch_points[event.index] = {} @@ -150,6 +152,8 @@ func _input(event): else: if touch_points.has(event.index): touch_points.erase(event.index) + elif (event is InputEventMouse): + Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) update_data() ##########################################################################