-
Hi all, My ideas was to create a copy of a form but with a fixed cursor. Let's call the copy form_2, and the original form_1. I'm sure there can be more complex lock screen, I was thinking this one was an easy to make. Sadly I'm stuck, cause I don't know how to fix the cursor position and where in the code I should do that (callback ?). Maybe something like :
If you can help... Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
To avoid cursor movements in form_2, you could just stop sending the cursor movement commands. Lets consider this code: u8g2/sys/arduino/u8g2_page_buffer/MUIInput3BtnBounce2/MUIInput3BtnBounce2.ino Lines 540 to 554 in eba8b1a You could check for form_2 (let me assume it has the number 2) and suppress any cursor movements. The modified code could look like this: void handle_events(void) {
int form = mui.getCurrentFormId();;
if ( selectBtn.pressed() ) {
mui.sendSelect();
is_redraw = 1;
}
else if ( nextBtn.pressed() && from != 2) {
mui.nextField();
is_redraw = 1;
}
else if ( prevBtn.pressed() && from != 2 ) {
mui.prevField();
is_redraw = 1;
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi, I tried it today, |
Beta Was this translation helpful? Give feedback.
I think you need to get the current position via
mui_GetCurrentCursorFocusPosition(mui.GetMUI())
and then later restore the cursor position withgotoForm(uint8_t form_id, uint8_t initial_cursor_position)
.In other words, you might need to create your own MUIF here, because the existing goto muif will always put the cursor into the first position.
Let me extend the code from here:
u8g2/csrc/mui_u8g2.c
Lines 469 to 497 in eba8b1a