mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Basic stub functionality for TextEdit
.
This can barely be called "support." It reads all text as a single block. I'd like to at least be able to unfocus the `TextEdit`, but it's going to require a custom key. Ctrl-tab and Ctrl-shift-tab seem like good candidates, but the editor grabs those already.
This commit is contained in:
parent
fc3c70e16c
commit
82b24801a3
|
@ -243,6 +243,20 @@ func popup_menu_item_id_pressed(index):
|
||||||
else:
|
else:
|
||||||
TTS.speak("unchecked", true)
|
TTS.speak("unchecked", true)
|
||||||
|
|
||||||
|
func text_edit_focus():
|
||||||
|
var tokens = PoolStringArray([])
|
||||||
|
if node.text:
|
||||||
|
tokens.append(node.text)
|
||||||
|
else:
|
||||||
|
tokens.append("blank")
|
||||||
|
if node.readonly:
|
||||||
|
tokens.append("read-only edit text")
|
||||||
|
else:
|
||||||
|
tokens.append("edit text")
|
||||||
|
TTS.speak(tokens.join(": "), false)
|
||||||
|
|
||||||
|
func text_edit_input(event):
|
||||||
|
pass
|
||||||
|
|
||||||
func tree_item_render():
|
func tree_item_render():
|
||||||
var focused_tree_item = node.get_selected()
|
var focused_tree_item = node.get_selected()
|
||||||
|
@ -438,6 +452,8 @@ func focused():
|
||||||
progress_bar_focused()
|
progress_bar_focused()
|
||||||
elif node is TabContainer:
|
elif node is TabContainer:
|
||||||
tab_container_focused()
|
tab_container_focused()
|
||||||
|
elif node is TextEdit:
|
||||||
|
text_edit_focus()
|
||||||
elif node is TextureButton:
|
elif node is TextureButton:
|
||||||
texturebutton_focused()
|
texturebutton_focused()
|
||||||
elif node is Tree:
|
elif node is Tree:
|
||||||
|
@ -476,6 +492,8 @@ func gui_input(event):
|
||||||
return item_list_input(event)
|
return item_list_input(event)
|
||||||
elif node is LineEdit:
|
elif node is LineEdit:
|
||||||
return line_edit_input(event)
|
return line_edit_input(event)
|
||||||
|
elif node is TextEdit:
|
||||||
|
return text_edit_input(event)
|
||||||
elif node is Tree:
|
elif node is Tree:
|
||||||
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_down") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_right"):
|
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_down") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_right"):
|
||||||
node.accept_event()
|
node.accept_event()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user