mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-13 00:55:56 +00:00
27 lines
714 B
GDScript
27 lines
714 B
GDScript
extends Object
|
|
|
|
var node
|
|
|
|
func focused():
|
|
print("Focus entered.", self.node)
|
|
|
|
func unfocused():
|
|
print("Unfocused", self.node)
|
|
|
|
func gui_input():
|
|
print("GUI input.")
|
|
|
|
func _init(node):
|
|
if node.is_in_group("accessible"):
|
|
return
|
|
node.add_to_group("accessible")
|
|
print(node.get_path())
|
|
self.node = node
|
|
self.node.set_focus_mode(Control.FOCUS_ALL)
|
|
self.node.connect("focus_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("tree_exiting", self, "free")
|