From 8f3a8ad730ecd2fb5226c3c288b68c460480dd8b Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:17:09 +0200 Subject: [PATCH] Keyboard ok to toggle select all in cursor mode --nobuild --- applications/services/gui/modules/text_input.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/applications/services/gui/modules/text_input.c b/applications/services/gui/modules/text_input.c index 2df6e5a05..c961dcd19 100644 --- a/applications/services/gui/modules/text_input.c +++ b/applications/services/gui/modules/text_input.c @@ -420,6 +420,7 @@ static void text_input_handle_down(TextInput* text_input, TextInputModel* model) static void text_input_handle_left(TextInput* text_input, TextInputModel* model) { UNUSED(text_input); if(model->cursor_select) { + model->clear_default_text = false; if(model->cursor_pos > 0) { model->cursor_pos = CLAMP(model->cursor_pos - 1, strlen(model->text_buffer), 0u); } @@ -434,6 +435,7 @@ static void text_input_handle_left(TextInput* text_input, TextInputModel* model) static void text_input_handle_right(TextInput* text_input, TextInputModel* model) { UNUSED(text_input); if(model->cursor_select) { + model->clear_default_text = false; model->cursor_pos = CLAMP(model->cursor_pos + 1, strlen(model->text_buffer), 0u); } else if( model->selected_column < @@ -445,7 +447,10 @@ static void text_input_handle_right(TextInput* text_input, TextInputModel* model } static void text_input_handle_ok(TextInput* text_input, TextInputModel* model, InputType type) { - if(model->cursor_select) return; + if(model->cursor_select) { + model->clear_default_text = !model->clear_default_text; + return; + } bool shift = type == InputTypeLong; bool repeat = type == InputTypeRepeat; char selected = get_selected_char(model);