App:Library:LVGL:docs:Porting:Input device interface
提供: robot-jp wiki
ナビゲーションに移動検索に移動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 mouseLV_INDEV_TYPE_KEYPAD
keyboard or keypadLV_INDEV_TYPE_ENCODER
encoder with left/right turn and push optionsLV_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.