Show mouse cursor when mouse used
This commit is contained in:
parent
8ac3f9d945
commit
835c49da11
|
@ -139,9 +139,11 @@ func _input(event):
|
||||||
# Unfortunately event.device does NOT differentiate touchscreen inputs on X11, Godot v3.1.1
|
# 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
|
# As such, we'll need to do some fancy mapping for multiple inputs
|
||||||
if (event is InputEventScreenDrag):
|
if (event is InputEventScreenDrag):
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||||
touch_points[event.index] = {pressed = true, position = event.position}
|
touch_points[event.index] = {pressed = true, position = event.position}
|
||||||
swipe_momentum = event.speed
|
swipe_momentum = event.speed
|
||||||
elif (event is InputEventScreenTouch):
|
elif (event is InputEventScreenTouch):
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
if not touch_points.has(event.index):
|
if not touch_points.has(event.index):
|
||||||
touch_points[event.index] = {}
|
touch_points[event.index] = {}
|
||||||
|
@ -150,6 +152,8 @@ func _input(event):
|
||||||
else:
|
else:
|
||||||
if touch_points.has(event.index):
|
if touch_points.has(event.index):
|
||||||
touch_points.erase(event.index)
|
touch_points.erase(event.index)
|
||||||
|
elif (event is InputEventMouse):
|
||||||
|
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||||
update_data()
|
update_data()
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
Loading…
Reference in New Issue