mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Try everything I can think of to get focus working. Grab click focus, make every single control focusable every way possible, track focus_exited for more insight. Nothing works.
This commit is contained in:
parent
5d359dba8e
commit
035a0699e1
|
@ -5,16 +5,19 @@ var Accessible = preload("accessible.gd")
|
||||||
|
|
||||||
func _augment_node(node):
|
func _augment_node(node):
|
||||||
if node is Control:
|
if node is Control:
|
||||||
|
node.set_focus_mode(Control.FOCUS_ALL)
|
||||||
Accessible.new(node)
|
Accessible.new(node)
|
||||||
|
|
||||||
func _set_initial_screen_focus(screen):
|
func _set_initial_screen_focus(screen):
|
||||||
|
print("Screen ",screen)
|
||||||
var focus
|
var focus
|
||||||
var root = self
|
var root = self
|
||||||
while root.get_parent() != null:
|
while root.get_parent() != null:
|
||||||
root = root.get_parent()
|
root = root.get_parent()
|
||||||
if screen == "3D":
|
if screen == "3D":
|
||||||
focus = root.find_node("LineEdit", true, false)
|
focus = root.find_node("ToolButton", true, false)
|
||||||
print("Focus ",focus)
|
print("Focus ",focus)
|
||||||
|
focus.grab_click_focus()
|
||||||
focus.grab_focus()
|
focus.grab_focus()
|
||||||
|
|
||||||
func _set_initial_scene_focus(scene):
|
func _set_initial_scene_focus(scene):
|
||||||
|
|
|
@ -5,13 +5,18 @@ var node
|
||||||
func _focused():
|
func _focused():
|
||||||
print("Focus entered.")
|
print("Focus entered.")
|
||||||
|
|
||||||
|
func _unfocused():
|
||||||
|
print("Unfocused")
|
||||||
|
|
||||||
func _gui_input():
|
func _gui_input():
|
||||||
print("GUI input.")
|
print("GUI input.")
|
||||||
|
|
||||||
func _init(node):
|
func _init(node):
|
||||||
print(node.get_path())
|
# print(node.get_path())
|
||||||
self.node = node
|
self.node = node
|
||||||
self.node.connect("focus_entered", self, "_focused")
|
self.node.connect("focus_entered", self, "_focused")
|
||||||
self.node.connect("mouse_entered", self, "_focused")
|
self.node.connect("mouse_entered", self, "_focused")
|
||||||
|
self.node.connect("focus_exited", self, "_unfocused")
|
||||||
|
self.node.connect("mouse_exited", self, "_unfocused")
|
||||||
self.node.connect("gui_input", self, "_gui_input")
|
self.node.connect("gui_input", self, "_gui_input")
|
||||||
self.node.connect("tree_exiting", self, "free")
|
self.node.connect("tree_exiting", self, "free")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user