Open everedero opened 6 months ago
hi,
You need to register your input device. For 2048 games, you need to register keypads:
static lv_indev_drv_t keypad_driver;
lv_indev_drv_init(&keypad_driver); /*Basic initialization*/
keypad_driver.type =LV_INDEV_TYPE_KEYPAD; /*See below.*/
keypad_driver.read_cb =you_read_cb ; /*See below.*/
/*Register the driver in LVGL and save the created input device object*/
lv_indev_t * keypad_indev = lv_indev_drv_register(&keypad_driver);
Then:
lv_group_t * g = lv_group_create();
lv_group_set_default(g);
lv_indev_set_group(keypad_indev, g);
Reference:
Hi! I have been using the 2048 app with Zephyr RTOS on a board with keypad buttons.
In order to make it work, I had to add an object group (lv_group_t ), as mentionned in LVGL Readme . Then I put the 2048 button matrix in it:
lv_group_add_obj(btn_matrix_group, game_2048->btnm);
and then link it to the keypad input object:
lv_indev_set_group(lvgl_input_get_indev(lvgl_keypad), btn_matrix_group);
The whole commit is here.
Do you think it could be missing in your lvgl port too?