You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
is there a callback message for U32NUMFN that indicates, when the cursor is on
the certain element?
My intention is to change the key assignment when editing an input field like
U32NUM.
I tried implementing a callback function to U32NUMFN, which sets a flag to
change key assignment:
uint32_t u32_cb(m2_rom_void_p element, uint8_t msg, uint32_t val)
{ if ( msg == M2_U32_MSG_SET_VALUE ){
return_value=val;
Num_Flag=1;}
return return_value;}
Unfortunately this works only when the displayed value of the element is
changed, not if I only shift from one digit to the next.
I would need a message that is send on all events when the cursor is on the
input element, but only then.
Is there any? Or maybe a workaround. I believe there must be, as the the
element needs to know when it's activated.
Thank you very much for help.
Original issue reported on code.google.com by [email protected] on 5 Sep 2014 at 11:15
The text was updated successfully, but these errors were encountered:
You could make a copy of m2elu32.c, rename the identifiers and implement an
updated function M2_EL_FN_DEF(m2_el_digit_fn)
Within m2_el_digit_fn you can get the current position with
m2_el_u32_get_digit_pos(fn_arg->nav)
Thank you.
Unfortunately, I was not talented enough to use your suggestions.
After some trial and error I was able to put a Num_Flag close to the end of the
file you mentioned.
Here:
case M2_EL_MSG_SHOW:
if ( fn_arg->arg == 1 )
{
Num_Flag=1;
m2_pos_p b = (m2_pos_p)(fn_arg->data);
uint8_t w = m2_fn_get_width((fn_arg->element));
uint8_t h = m2_fn_get_height((fn_arg->element));
m2_gfx_normal_parent_focus(b->x, b->y, w, h, font);
return 0;
}
break;
Now the flag is true whenever the cursor is on a numerical field.
That's what I need to freely reassign my keys whenever I enter a u32num input
field.
Original issue reported on code.google.com by
[email protected]
on 5 Sep 2014 at 11:15The text was updated successfully, but these errors were encountered: