Unfocus LineEdit when pressing Escape
This commit is contained in:
parent
247c3548d8
commit
e21c30ec11
@ -482,6 +482,11 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (k->is_action("ui_cancel")) {
|
||||||
|
release_focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_shortcut_keys_enabled()) {
|
if (is_shortcut_keys_enabled()) {
|
||||||
if (k->is_action("ui_copy", true)) {
|
if (k->is_action("ui_copy", true)) {
|
||||||
copy_text();
|
copy_text();
|
||||||
|
@ -210,6 +210,11 @@ void SpinBox::_line_edit_focus_exit() {
|
|||||||
if (line_edit->is_menu_visible()) {
|
if (line_edit->is_menu_visible()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Discontinue because the focus_exit was caused by canceling.
|
||||||
|
if (Input::get_singleton()->is_action_pressed("ui_cancel")) {
|
||||||
|
_update_text();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_text_submitted(line_edit->get_text());
|
_text_submitted(line_edit->get_text());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user