mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Remove need for custom signal.
This commit is contained in:
parent
6d1d0f914e
commit
9899940106
|
@ -33,12 +33,17 @@ func present_line_edit():
|
||||||
type = "text"
|
type = "text"
|
||||||
print("%s: %s" % [text, type])
|
print("%s: %s" % [text, type])
|
||||||
|
|
||||||
func caret_moved():
|
var old_pos
|
||||||
|
|
||||||
|
func check_caret_moved():
|
||||||
var pos = node.caret_position
|
var pos = node.caret_position
|
||||||
var text = node.text
|
if old_pos != pos:
|
||||||
if pos > len(text)-1:
|
var text = node.text
|
||||||
return
|
if pos > len(text)-1:
|
||||||
print(text[pos])
|
print("blank")
|
||||||
|
else:
|
||||||
|
print(text[pos])
|
||||||
|
old_pos = pos
|
||||||
|
|
||||||
func present_tree():
|
func present_tree():
|
||||||
var root = node.get_root()
|
var root = node.get_root()
|
||||||
|
@ -61,7 +66,8 @@ func unfocused():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func gui_input(event):
|
func gui_input(event):
|
||||||
pass
|
if self.node is LineEdit:
|
||||||
|
check_caret_moved()
|
||||||
|
|
||||||
func _init(node):
|
func _init(node):
|
||||||
if node.is_in_group("accessible"):
|
if node.is_in_group("accessible"):
|
||||||
|
@ -74,6 +80,4 @@ func _init(node):
|
||||||
self.node.connect("focus_exited", self, "unfocused")
|
self.node.connect("focus_exited", self, "unfocused")
|
||||||
self.node.connect("mouse_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")
|
||||||
if self.node is LineEdit:
|
|
||||||
self.node.connect("caret_moved", self, "caret_moved")
|
|
||||||
self.node.connect("tree_exiting", self, "free")
|
self.node.connect("tree_exiting", self, "free")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user