Merge pull request #35814 from timothyqiu/line-edit-shortcut

Adds CTRL-A CTRL-E support to LineEdit on macOS
This commit is contained in:
Rémi Verschelde 2020-02-09 12:51:59 +01:00 committed by GitHub
commit 7f95e027b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,8 @@
- Ctrl + N: Like the down arrow key, move the cursor to the next line - 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 + 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 + 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 + 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 - Command + Right arrow: Like the End key, move the cursor to the end of the line
</description> </description>

View File

@ -184,6 +184,12 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
case KEY_H: { case KEY_H: {
remap_key = KEY_BACKSPACE; remap_key = KEY_BACKSPACE;
} break; } break;
case KEY_A: {
remap_key = KEY_HOME;
} break;
case KEY_E: {
remap_key = KEY_END;
} break;
} }
if (remap_key != KEY_UNKNOWN) { if (remap_key != KEY_UNKNOWN) {