From 4774043f8e38a9efb0991458cf0f6d4636329d93 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sat, 1 Feb 2020 13:35:16 +0800 Subject: Adds CTRL-A CTRL-E support to LineEdit on macOS --- doc/classes/LineEdit.xml | 2 ++ scene/gui/line_edit.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 59bad00f25..f60363c929 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -22,6 +22,8 @@ - Ctrl + N: Like the down arrow key, move the cursor to the next line - Ctrl + D: Like the Delete key, delete the character on the right side of cursor - Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor + - Ctrl + A: Like the Home key, move the cursor to the beginning of the line + - Ctrl + E: Like the End key, move the cursor to the end of the line - Command + Left arrow: Like the Home key, move the cursor to the beginning of the line - Command + Right arrow: Like the End key, move the cursor to the end of the line diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 7afc3b0d00..9a9e473100 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -184,6 +184,12 @@ void LineEdit::_gui_input(Ref p_event) { case KEY_H: { remap_key = KEY_BACKSPACE; } break; + case KEY_A: { + remap_key = KEY_HOME; + } break; + case KEY_E: { + remap_key = KEY_END; + } break; } if (remap_key != KEY_UNKNOWN) { -- cgit v1.2.3