diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-04-11 17:50:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 17:50:41 +0200 |
commit | b936359e0792b4eb06290b59baefd57f551f6e1e (patch) | |
tree | ec4c8b8fa43f0de4f05fa05c6c160070199a309f /scene/gui | |
parent | 9528aa42be2cffb24971955191385b6603abb0dd (diff) | |
parent | a3d82f5afbbb8a4b4f4037d4baf6607d9b9cfa8b (diff) |
Merge pull request #60026 from ConteZero/shortcut_keys_enabled
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 86969e3ef4..ff23e44cb7 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1944,44 +1944,45 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) { return; } - // SELECT ALL, SELECT WORD UNDER CARET, CUT, COPY, PASTE. - - if (k->is_action("ui_text_select_all", true)) { - select_all(); - accept_event(); - return; - } - if (k->is_action("ui_text_select_word_under_caret", true)) { - select_word_under_caret(); - accept_event(); - return; - } - if (k->is_action("ui_cut", true)) { - cut(); - accept_event(); - return; - } - if (k->is_action("ui_copy", true)) { - copy(); - accept_event(); - return; - } - if (k->is_action("ui_paste", true)) { - paste(); - accept_event(); - return; - } + if (is_shortcut_keys_enabled()) { + // SELECT ALL, SELECT WORD UNDER CARET, CUT, COPY, PASTE. + if (k->is_action("ui_text_select_all", true)) { + select_all(); + accept_event(); + return; + } + if (k->is_action("ui_text_select_word_under_caret", true)) { + select_word_under_caret(); + accept_event(); + return; + } + if (k->is_action("ui_cut", true)) { + cut(); + accept_event(); + return; + } + if (k->is_action("ui_copy", true)) { + copy(); + accept_event(); + return; + } + if (k->is_action("ui_paste", true)) { + paste(); + accept_event(); + return; + } - // UNDO/REDO. - if (k->is_action("ui_undo", true)) { - undo(); - accept_event(); - return; - } - if (k->is_action("ui_redo", true)) { - redo(); - accept_event(); - return; + // UNDO/REDO. + if (k->is_action("ui_undo", true)) { + undo(); + accept_event(); + return; + } + if (k->is_action("ui_redo", true)) { + redo(); + accept_event(); + return; + } } // MISC. |