1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Merge pull request #73074 from M4rYu5/capslock-editor-completion-fix

Editor: Ignore CapsLock when pressed alone
This commit is contained in:
Rémi Verschelde
2023-04-03 15:58:11 +02:00
2 changed files with 5 additions and 5 deletions

View File

@@ -460,12 +460,12 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
} }
/* If a modifier has been pressed, and nothing else, return. */ /* If a modifier has been pressed, and nothing else, return. */
if (!k->is_pressed() || k->get_keycode() == Key::CTRL || k->get_keycode() == Key::ALT || k->get_keycode() == Key::SHIFT || k->get_keycode() == Key::META) { if (!k->is_pressed() || k->get_keycode() == Key::CTRL || k->get_keycode() == Key::ALT || k->get_keycode() == Key::SHIFT || k->get_keycode() == Key::META || k->get_keycode() == Key::CAPSLOCK) {
return; return;
} }
/* Allow unicode handling if: */ // Allow unicode handling if:
/* No Modifiers are pressed (except shift) */ // No modifiers are pressed (except Shift and CapsLock)
bool allow_unicode_handling = !(k->is_command_or_control_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed()); bool allow_unicode_handling = !(k->is_command_or_control_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());
/* AUTO-COMPLETE */ /* AUTO-COMPLETE */

View File

@@ -2008,14 +2008,14 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
} }
// If a modifier has been pressed, and nothing else, return. // If a modifier has been pressed, and nothing else, return.
if (k->get_keycode() == Key::CTRL || k->get_keycode() == Key::ALT || k->get_keycode() == Key::SHIFT || k->get_keycode() == Key::META) { if (k->get_keycode() == Key::CTRL || k->get_keycode() == Key::ALT || k->get_keycode() == Key::SHIFT || k->get_keycode() == Key::META || k->get_keycode() == Key::CAPSLOCK) {
return; return;
} }
_reset_caret_blink_timer(); _reset_caret_blink_timer();
// Allow unicode handling if: // Allow unicode handling if:
// * No Modifiers are pressed (except shift) // * No modifiers are pressed (except Shift and CapsLock)
bool allow_unicode_handling = !(k->is_command_or_control_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed()); bool allow_unicode_handling = !(k->is_command_or_control_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());
// Check and handle all built in shortcuts. // Check and handle all built in shortcuts.