mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-12-21 15:15:57 +00:00
Allow a global override to determine if the next focus event should interrupt speech.
There seem to be a small handful of cases where we want this--controls that gain focus immediately after a dialog appears, for instance. We allow these edge cases to indicate that the next focus shouldn't stop speech, then clear it on cases where speech isn't stopped. This is a bit hacky, but seems cleaner than anything else I came up with.
This commit is contained in:
parent
c218d18090
commit
54c01c5381
|
@ -54,7 +54,7 @@ func _guess_label():
|
|||
|
||||
func _accept_dialog_speak():
|
||||
if node.dialog_text != "":
|
||||
TTS.speak("dialog: %s" % node.dialog_text)
|
||||
TTS.speak("dialog: %s" % node.dialog_text, false)
|
||||
|
||||
|
||||
func accept_dialog_focused():
|
||||
|
@ -66,6 +66,7 @@ func accept_dialog_focused():
|
|||
|
||||
func _accept_dialog_about_to_show():
|
||||
_accept_dialog_speak()
|
||||
ScreenReader.should_stop_on_focus = false
|
||||
|
||||
|
||||
func checkbox_focused():
|
||||
|
@ -543,7 +544,9 @@ func tab_container_input(event):
|
|||
|
||||
func focused():
|
||||
print_debug("Focus: %s" % node)
|
||||
TTS.stop()
|
||||
if ScreenReader.should_stop_on_focus:
|
||||
TTS.stop()
|
||||
ScreenReader.should_stop_on_focus = true
|
||||
if not node is Label:
|
||||
var label = _guess_label()
|
||||
if label:
|
||||
|
|
|
@ -21,6 +21,7 @@ export var explore_by_touch_interval = 200
|
|||
|
||||
export var enable_focus_mode = false
|
||||
|
||||
var should_stop_on_focus = true
|
||||
|
||||
func _set_enabled(v):
|
||||
if enabled:
|
||||
|
|
Loading…
Reference in New Issue
Block a user