Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CTRL + ALT + special character #52452

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {

// Allow unicode handling if:
// * No Modifiers are pressed (except shift)
bool allow_unicode_handling = !(k->is_command_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());

if (allow_unicode_handling && editable && k->get_unicode() >= 32) {
if (editable && k->get_unicode() >= 32) {
// Handle Unicode (if no modifiers active)
selection_delete();
char32_t ucodestr[2] = { (char32_t)k->get_unicode(), 0 };
Expand All @@ -501,7 +499,6 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
if (text.length() != prev_len) {
_text_changed();
}
accept_event();
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,10 +1583,6 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {

_reset_caret_blink_timer();

// Allow unicode handling if:
// * No Modifiers are pressed (except shift)
bool allow_unicode_handling = !(k->is_command_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());

selection.selecting_text = false;

// Check and handle all built in shortcuts.
Expand Down Expand Up @@ -1794,9 +1790,8 @@ void TextEdit::gui_input(const Ref<InputEvent> &p_gui_input) {
}

// Handle Unicode (if no modifiers active). Tab has a value of 0x09.
if (allow_unicode_handling && editable && (k->get_unicode() >= 32 || k->get_keycode() == KEY_TAB)) {
if (editable && (k->get_unicode() >= 32 || k->get_keycode() == KEY_TAB)) {
handle_unicode_input(k->get_unicode());
accept_event();
return;
}
}
Expand Down