-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unfocus LineEdit when pressing Escape #81128
Unfocus LineEdit when pressing Escape #81128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
More reviews from @godotengine/gui-nodes welcome.
Thanks! |
Would this make sense to do for TextEdit as well? It might be an issue for autocompletion users, so it'll surely have to be optional there. (I'd say it should be enabled by default still – we can disable it for specific things such as the script/shader editor.) |
It could be used for multiline fields in the inspector, so IMO makes sense. (I also have a plugin that would benefit from this) |
Probably should use # gdscript not C++, but this works as expected on LineEdit
func _gui_input(event: InputEvent) -> void:
if event.is_action(&"ui_cancel"):
release_focus()
accept_event() Otherwise, if I have escape on unhandled input to reload current scene, I get this (separate bug?),
MRP: func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed(&"ui_cancel"):
get_tree().reload_current_scene()
# plus LineEdit somewhere (Also, TextEdit makes sense yes) |
Closes godotengine/godot-proposals#7543