App:Library:LVGL:docs:Porting:Input device interface

提供: robot-jp wiki
2022年6月22日 (水) 09:42時点におけるTakashi (トーク | 投稿記録)による版
ナビゲーションに移動検索に移動

https://docs.lvgl.io/8.2/porting/indev.html

英文 自動翻訳


Input device interface

Types of input devices

To register an input device an lv_indev_drv_t variable has to be initialized. Be sure to register at least one display before you register any input devices.

lv_disp_drv_register(&disp_drv);

static lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);      /*Basic initialization*/
indev_drv.type =...                 /*See below.*/
indev_drv.read_cb =...              /*See below.*/
/*Register the driver in LVGL and save the created input device object*/
lv_indev_t * my_indev = lv_indev_drv_register(&indev_drv);

The type member can be:

  • LV_INDEV_TYPE_POINTER touchpad or mouse
  • LV_INDEV_TYPE_KEYPAD keyboard or keypad
  • LV_INDEV_TYPE_ENCODER encoder with left/right turn and push options
  • LV_INDEV_TYPE_BUTTON external buttons virtually pressing the screen

read_cb is a function pointer which will be called periodically to report the current state of an input device.

Visit Input devices to learn more about input devices in general.



戻る : Previous