This sample runs the keypad and encoder demo that comes with LVGL: tabs of widgets that are used without a pointer. Up and Down move the focus, Select clicks or edits the focused widget and Back leaves it.
Unlike most samples it does not end.
pbl samples samples/third_party/lvgl/keypad_encoder
every board
#include <stdio.h>
#include <pbl/kernel/delay.h>
#include <demos/lv_demos.h>
#include <pbl_lvgl.h>
int main(void) {
int ret;
ret = pbl_lvgl_init();
if (ret != 0) {
fprintf(stderr, "lvgl: init failed (%d)\n", ret);
return ret;
}
/* The demos come with LVGL, each enabled by its CONFIG_LV_USE_DEMO_* option. */
lv_demo_keypad_encoder();
printf("lvgl: keypad and encoder on %dx%d\n",
(int)lv_display_get_horizontal_resolution(pbl_lvgl_get_display()),
(int)lv_display_get_vertical_resolution(pbl_lvgl_get_display()));
while (true) {
pbl_sleep_ms(lv_timer_handler());
}
}
lvgl: keypad and encoder on \d+x\d+
Generated from PebbleOS 4bbc630fa. This page is maintained in the pebbleos repository: docs/samples/third_party/lvgl/keypad_encoder.md.