Use defined key mapping for closing popups and dialogs

As opposed to hardcoding the escape key. Also removed such hardcoding in a few other places as well as a hardcoded enter key in one of the affected input fields.
This commit is contained in:
Arman Elgudzhyan 2023-05-20 17:26:13 -07:00
parent 809a982162
commit 8ab2cf3d2d
7 changed files with 26 additions and 66 deletions

View file

@ -2415,7 +2415,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
}
}
if (k.is_valid() && k->is_pressed() && k->get_keycode() == Key::ESCAPE && drag_type == DRAG_NONE && tool == TOOL_SELECT) {
if (k.is_valid() && k->is_action_pressed(SNAME("ui_cancel"), false, true) && drag_type == DRAG_NONE && tool == TOOL_SELECT) {
// Unselect everything
editor_selection->clear();
viewport->queue_redraw();