Description
I made custom widget and I want to handle this widget by key event.
so. I defined lv_custom_class like bleow,
const lv_obj_class_t lv_custom_class = {
.constructor_cb = lv_custom_constructor,
.destructor_cb = lv_custom_destructor,
.event_cb = lv_custom_event,
.width_def = LV_PCT(100),
…
static void lv_custom_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
if( code == LV_EVENT_KEY)
{
// do something
}
}
but, custom widget doesn’t receive “LV_EVENT_KEY” event.
is there any pre-condition for custom widget to get KEY event?
What MCU/Processor/Board and compiler are you using?
lv_sim_vscode_sdl
What LVGL version are you using?
8.1
What do you want to achieve?
custom widget to get “LV_EVENT_KEY” event
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
please refer to above code.
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.