Add basic touchscreen support for sliders.

This commit is contained in:
Nolan Darilek 2020-06-09 13:23:58 -05:00
parent 5852285dd4
commit 8ee1c05512
2 changed files with 14 additions and 2 deletions

View File

@ -306,6 +306,8 @@ func range_focused():
tokens.append("range") tokens.append("range")
tokens.append("minimum %s" % node.min_value) tokens.append("minimum %s" % node.min_value)
tokens.append("maximum %s" % node.max_value) tokens.append("maximum %s" % node.max_value)
if OS.has_touchscreen_ui_hint():
tokens.append("Swipe up and down to change.")
TTS.speak(tokens.join(": "), false) TTS.speak(tokens.join(": "), false)

View File

@ -179,11 +179,21 @@ func swipe_left():
func swipe_up(): func swipe_up():
TTS.speak("Swipe up") var focus = find_focusable_control(get_tree().root)
if focus:
focus = focus.get_focus_owner()
if focus:
if focus is Range:
_press_and_release("ui_right")
func swipe_down(): func swipe_down():
TTS.speak("Swipe down") var focus = find_focusable_control(get_tree().root)
if focus:
focus = focus.get_focus_owner()
if focus:
if focus is Range:
_press_and_release("ui_left")
var touch_index = null var touch_index = null