mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-25 13:25:56 +00:00
Another attempted fix for cases where focus is unset and nothing can be done.
When we unfocus, wait a second. If we don't have focus after the timer elapses, warp the mouse to the global coordinates. This seems to restore some semblance of focus whenever it is unset, while not breaking the case where a focus is set and the mouse suddenly jumps, thus changing the focus again.
This commit is contained in:
parent
636c275c7f
commit
ca73c2f255
|
@ -378,6 +378,9 @@ func focus():
|
||||||
func unfocus():
|
func unfocus():
|
||||||
print("Unfocused")
|
print("Unfocused")
|
||||||
position_in_children = 0
|
position_in_children = 0
|
||||||
|
yield(node.get_tree().create_timer(1), "timeout")
|
||||||
|
if not node.get_focus_owner():
|
||||||
|
node.get_tree().root.warp_mouse(node.rect_global_position)
|
||||||
|
|
||||||
func click_focus():
|
func click_focus():
|
||||||
if node.has_focus():
|
if node.has_focus():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user