summaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 52cb711bfe..76d83529e8 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2556,9 +2556,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
k = k->duplicate(); // It will be modified later on.
#ifdef OSX_ENABLED
- if (k->get_scancode() == KEY_META) {
+ if (k->get_keycode() == KEY_META) {
#else
- if (k->get_scancode() == KEY_CONTROL) {
+ if (k->get_keycode() == KEY_CONTROL) {
#endif
if (select_identifiers_enabled) {
@@ -2589,7 +2589,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (valid) {
if (!k->get_alt()) {
- if (k->get_scancode() == KEY_UP) {
+ if (k->get_keycode() == KEY_UP) {
if (completion_index > 0) {
completion_index--;
@@ -2603,7 +2603,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_DOWN) {
+ if (k->get_keycode() == KEY_DOWN) {
if (completion_index < completion_options.size() - 1) {
completion_index++;
@@ -2617,7 +2617,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_PAGEUP) {
+ if (k->get_keycode() == KEY_PAGEUP) {
completion_index -= get_constant("completion_lines");
if (completion_index < 0)
@@ -2628,7 +2628,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_PAGEDOWN) {
+ if (k->get_keycode() == KEY_PAGEDOWN) {
completion_index += get_constant("completion_lines");
if (completion_index >= completion_options.size())
@@ -2639,7 +2639,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_HOME && completion_index > 0) {
+ if (k->get_keycode() == KEY_HOME && completion_index > 0) {
completion_index = 0;
completion_current = completion_options[completion_index];
@@ -2648,7 +2648,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_END && completion_index < completion_options.size() - 1) {
+ if (k->get_keycode() == KEY_END && completion_index < completion_options.size() - 1) {
completion_index = completion_options.size() - 1;
completion_current = completion_options[completion_index];
@@ -2657,14 +2657,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_KP_ENTER || k->get_scancode() == KEY_ENTER || k->get_scancode() == KEY_TAB) {
+ if (k->get_keycode() == KEY_KP_ENTER || k->get_keycode() == KEY_ENTER || k->get_keycode() == KEY_TAB) {
_confirm_completion();
accept_event();
return;
}
- if (k->get_scancode() == KEY_BACKSPACE) {
+ if (k->get_keycode() == KEY_BACKSPACE) {
_reset_caret_blink_timer();
@@ -2674,7 +2674,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (k->get_scancode() == KEY_SHIFT) {
+ if (k->get_keycode() == KEY_SHIFT) {
accept_event();
return;
}
@@ -2718,20 +2718,20 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
/* TEST CONTROL FIRST! */
// Some remaps for duplicate functions.
- if (k->get_command() && !k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_scancode() == KEY_INSERT) {
+ if (k->get_command() && !k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_keycode() == KEY_INSERT) {
- k->set_scancode(KEY_C);
+ k->set_keycode(KEY_C);
}
- if (!k->get_command() && k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_scancode() == KEY_INSERT) {
+ if (!k->get_command() && k->get_shift() && !k->get_alt() && !k->get_metakey() && k->get_keycode() == KEY_INSERT) {
- k->set_scancode(KEY_V);
+ k->set_keycode(KEY_V);
k->set_command(true);
k->set_shift(false);
}
#ifdef APPLE_STYLE_KEYS
if (k->get_control() && !k->get_shift() && !k->get_alt() && !k->get_command()) {
uint32_t remap_key = KEY_UNKNOWN;
- switch (k->get_scancode()) {
+ switch (k->get_keycode()) {
case KEY_F: {
remap_key = KEY_RIGHT;
} break;
@@ -2753,7 +2753,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
if (remap_key != KEY_UNKNOWN) {
- k->set_scancode(remap_key);
+ k->set_keycode(remap_key);
k->set_control(false);
}
}
@@ -2771,7 +2771,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
bool unselect = false;
bool dobreak = false;
- switch (k->get_scancode()) {
+ switch (k->get_keycode()) {
case KEY_TAB: {
if (k->get_shift()) {
@@ -2845,11 +2845,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
selection.selecting_text = false;
- bool scancode_handled = true;
+ bool keycode_handled = true;
- // Special scancode test.
+ // Special keycode test.
- switch (k->get_scancode()) {
+ switch (k->get_keycode()) {
case KEY_KP_ENTER:
case KEY_ENTER: {
@@ -2971,7 +2971,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
completion_hint = "";
update();
} else {
- scancode_handled = false;
+ keycode_handled = false;
}
} break;
case KEY_TAB: {
@@ -3044,7 +3044,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (k->get_alt() && cursor.column > 1) {
#else
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
} else if (k->get_command() && cursor.column > 1) {
#endif
@@ -3101,7 +3101,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_4: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3137,7 +3137,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} else if (k->get_alt()) {
#else
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
} else if (k->get_command()) {
#endif
@@ -3177,7 +3177,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_6: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3199,7 +3199,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} else if (k->get_alt()) {
#else
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
} else if (k->get_command()) {
#endif
@@ -3238,7 +3238,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_8: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3246,7 +3246,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
case KEY_UP: {
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
#ifndef APPLE_STYLE_KEYS
@@ -3291,7 +3291,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_2: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3299,7 +3299,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
case KEY_DOWN: {
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
#ifndef APPLE_STYLE_KEYS
@@ -3359,7 +3359,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (k->get_alt() && cursor.column < curline_len - 1) {
#else
if (k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
} else if (k->get_command() && cursor.column < curline_len - 1) {
#endif
@@ -3414,7 +3414,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_7: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3475,7 +3475,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_1: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3522,7 +3522,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_9: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3545,7 +3545,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_KP_3: {
if (k->get_unicode() != 0) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
[[fallthrough]];
@@ -3570,7 +3570,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
#ifndef APPLE_STYLE_KEYS
if (!k->get_control() || k->get_shift() || k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
if (is_shortcut_keys_enabled()) {
@@ -3578,7 +3578,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
#else
if ((!k->get_command() && !k->get_control())) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
if (!k->get_shift() && k->get_command() && is_shortcut_keys_enabled())
@@ -3609,7 +3609,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
case KEY_E: {
if (!k->get_control() || k->get_command() || k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
@@ -3634,7 +3634,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
}
if (!k->get_command() || k->get_shift() || k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
if (is_shortcut_keys_enabled()) {
@@ -3645,7 +3645,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
case KEY_C: {
if (!k->get_command() || k->get_shift() || k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
@@ -3661,7 +3661,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
if (!k->get_command()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
@@ -3679,7 +3679,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
}
if (!k->get_command()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
@@ -3692,7 +3692,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
}
if (!k->get_command() || k->get_shift() || k->get_alt()) {
- scancode_handled = false;
+ keycode_handled = false;
break;
}
@@ -3709,9 +3709,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
#endif
query_code_comple();
- scancode_handled = true;
+ keycode_handled = true;
} else {
- scancode_handled = false;
+ keycode_handled = false;
}
} break;
@@ -3728,20 +3728,20 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
default: {
- scancode_handled = false;
+ keycode_handled = false;
} break;
}
- if (scancode_handled)
+ if (keycode_handled)
accept_event();
- if (k->get_scancode() == KEY_INSERT) {
+ if (k->get_keycode() == KEY_INSERT) {
set_insert_mode(!insert_mode);
accept_event();
return;
}
- if (!scancode_handled && !k->get_command()) { // For German keyboards.
+ if (!keycode_handled && !k->get_command()) { // For German keyboards.
if (k->get_unicode() >= 32) {