From a126876cc834aeb9c81b3f4abecf5836f0c02782 Mon Sep 17 00:00:00 2001 From: Anish Date: Mon, 23 Apr 2018 16:03:08 +0530 Subject: Adds support for CMD+Left and CMD+Right on MacOS CMD+Left and CMD+Right are hotkeys used on MacOS for moving cursor to start and end of the text, respectively. They are now supported, alongside ALT+key. Fixes: #17631 --- scene/gui/line_edit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index fe5f3b769c..6733c6ba16 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -215,6 +215,12 @@ void LineEdit::_gui_input(Ref p_event) { case (KEY_A): { //Select All select(); } break; + case (KEY_LEFT): { // Go to start of text - like HOME key + set_cursor_position(0); + } break; + case (KEY_RIGHT): { // Go to end of text - like END key + set_cursor_position(text.length()); + } break; default: { handled = false; } } -- cgit v1.2.3