From 7b7c7c8dc0e3572a7d66d274b3e4db43695ce814 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Sun, 6 Aug 2017 16:26:07 +0300 Subject: Rename KEY_RETURN to KEY_ENTER and KEY_ENTER to KEY_KP_ENTER Closes #7695 --- scene/gui/line_edit.cpp | 4 ++-- scene/gui/popup_menu.cpp | 4 ++-- scene/gui/text_edit.cpp | 6 +++--- scene/gui/tree.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index f4dd3e92cd..8556ce5db1 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -229,8 +229,8 @@ void LineEdit::_gui_input(Ref p_event) { bool handled = true; switch (code) { - case KEY_ENTER: - case KEY_RETURN: { + case KEY_KP_ENTER: + case KEY_ENTER: { emit_signal("text_entered", text); if (OS::get_singleton()->has_virtual_keyboard()) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index f59a2e06eb..b673f9d68a 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -249,8 +249,8 @@ void PopupMenu::_gui_input(const Ref &p_event) { } } } break; - case KEY_RETURN: - case KEY_ENTER: { + case KEY_ENTER: + case KEY_KP_ENTER: { if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 2fc3204f3a..a7c31361e8 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1805,7 +1805,7 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { return; } - if (k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_RETURN || k->get_scancode() == KEY_TAB) { + if (k->get_scancode() == KEY_KP_ENTER || k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_TAB) { _confirm_completion(); accept_event(); @@ -1974,8 +1974,8 @@ void TextEdit::_gui_input(const Ref &p_gui_input) { switch (k->get_scancode()) { - case KEY_ENTER: - case KEY_RETURN: { + case KEY_KP_ENTER: + case KEY_ENTER: { if (readonly) break; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 0b57841be7..9499ba9dcd 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1917,8 +1917,8 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool void Tree::_text_editor_modal_close() { if (Input::get_singleton()->is_key_pressed(KEY_ESCAPE) || - Input::get_singleton()->is_key_pressed(KEY_ENTER) || - Input::get_singleton()->is_key_pressed(KEY_RETURN)) { + Input::get_singleton()->is_key_pressed(KEY_KP_ENTER) || + Input::get_singleton()->is_key_pressed(KEY_ENTER)) { return; } @@ -2237,8 +2237,8 @@ void Tree::_gui_input(Ref p_event) { } break; case KEY_F2: - case KEY_RETURN: - case KEY_ENTER: { + case KEY_ENTER: + case KEY_KP_ENTER: { if (selected_item) { //bring up editor if possible -- cgit v1.2.3