1
0
Fork 0
This commit is contained in:
TCROC 2025-02-28 01:36:23 +01:00 committed by GitHub
commit 4e50128f52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 11 deletions

View File

@ -612,13 +612,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
return;
}
Ref<InputEventKey> k = p_event;
if (k.is_null()) {
return;
}
if (editable && !editing && k->is_action_pressed("ui_text_submit", false)) {
if (editable && !editing && p_event->is_action_pressed("ui_text_submit", false)) {
edit();
emit_signal(SNAME("editing_toggled"), true);
accept_event();
@ -627,7 +621,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
// Open context menu.
if (context_menu_enabled) {
if (k->is_action("ui_menu", true)) {
if (p_event->is_action("ui_menu", true)) {
_update_context_menu();
Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2);
menu->set_position(get_screen_position() + pos);
@ -641,19 +635,19 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (is_shortcut_keys_enabled()) {
if (k->is_action("ui_copy", true)) {
if (p_event->is_action("ui_copy", true)) {
copy_text();
accept_event();
return;
}
if (k->is_action("ui_text_select_all", true)) {
if (p_event->is_action("ui_text_select_all", true)) {
select();
accept_event();
return;
}
if (k->is_action("ui_cut", true)) {
if (p_event->is_action("ui_cut", true)) {
if (editable) {
cut_text();
} else {
@ -668,6 +662,12 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
return;
}
Ref<InputEventKey> k = p_event;
if (k.is_null()) {
return;
}
// Start Unicode input (hold).
if (k->is_alt_pressed() && k->get_keycode() == Key::KP_ADD && !alt_start && !alt_start_no_hold) {
if (selection.enabled) {