Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Fix keyboard cursor underflow with ascii events --nobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jan 24, 2024
1 parent 637d915 commit 36711fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions applications/services/gui/modules/text_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,10 @@ static bool text_input_view_ascii_callback(AsciiEvent* event, void* context) {
model->cursor_pos =
CLAMP(model->cursor_pos + 1, strlen(model->text_buffer), 0u);
} else {
model->cursor_pos =
CLAMP(model->cursor_pos - 1, strlen(model->text_buffer), 0u);
if(model->cursor_pos > 0) {
model->cursor_pos =
CLAMP(model->cursor_pos - 1, strlen(model->text_buffer), 0u);
}
}
},
true);
Expand Down

0 comments on commit 36711fc

Please sign in to comment.