Replies: 2 comments 1 reply
-
Let me assume you took over the event handler from here: Then the new event handler may look like this: void handle_events(void) {
// 0 = not pushed, 1 = pushed
if ( push_event == 1 ) {
mui.sendSelect();
is_redraw = 1;
push_event = 0;
}
if ( mui.getCurrentFormId() == 16 ) {
// 0 = not turning, 1 = CW, 2 = CCW
if ( rotary_event == 1 ) {
mui_SendValueIncrement(mui.getMUI());
is_redraw = 1;
rotary_event = 0;
}
if ( rotary_event == 2 ) {
mui_SendValueDecrement(mui.getMUI());
is_redraw = 1;
rotary_event = 0;
}
}
else {
// 0 = not turning, 1 = CW, 2 = CCW
if ( rotary_event == 1 ) {
mui.nextField();
is_redraw = 1;
rotary_event = 0;
}
if ( rotary_event == 2 ) {
mui.prevField();
is_redraw = 1;
rotary_event = 0;
}
}
} ... not tested... |
Beta Was this translation helpful? Give feedback.
-
Ty @olikraus, i didn't know that "mse" version would auto-activate a field. The second version you gave looks much nicer and cleaner (not to mess with handle_events) and i will try it next week when i get back. I was struggling with push the button to activate "back" command, i tried to use "MUIF_MSG_CURSOR_LEAVE" to call mui.gotoForm .. but the problem is every turn of rotary it is fired too (ENTER and LEAVE ), you have any idea how to get that functionality. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I have one form that is text input
MUIF_U8G2_U8_MIN_MAX("NV", &num_value, 0, 99, mui_u8g2_u8_min_max_wm_mud_pi),
and here is part of the form:
i want the form field "NV" to be auto-activated so that when i turn the rotary encoder it starts to go up/down .. now i need to press the encoder and then start to change it .. if it is only field on the form there is no need to sendSelect().
So when the user press the rotary button i would like to go to another form (exit)
Is that possible, i tried to find some examples but everything is using sendSelect()
Beta Was this translation helpful? Give feedback.
All reactions