「App:Library:LVGL:docs:Porting:Input device interface」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動 (ページの作成:「https://docs.lvgl.io/8.2/porting/indev.html __NOTOC__ {| class="wikitable" !英文 !自動翻訳 |- | | |- | | |- | | |- | | |- | | |- | | |- | | |- | | |} ---- App…」) |
|||
| 30行目: | 30行目: | ||
|} | |} | ||
| + | |||
| + | |||
| + | = Input device interface = | ||
| + | |||
| + | == Types of input devices == | ||
| + | To register an input device an <code>lv_indev_drv_t</code> 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 <code>type</code> member can be: | ||
| + | |||
| + | * <code>LV_INDEV_TYPE_POINTER</code> touchpad or mouse | ||
| + | * <code>LV_INDEV_TYPE_KEYPAD</code> keyboard or keypad | ||
| + | * <code>LV_INDEV_TYPE_ENCODER</code> encoder with left/right turn and push options | ||
| + | * <code>LV_INDEV_TYPE_BUTTON</code> external buttons virtually pressing the screen | ||
| + | |||
| + | <code>read_cb</code> 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. | ||
2022年6月22日 (水) 09:42時点における版
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_POINTERtouchpad or mouseLV_INDEV_TYPE_KEYPADkeyboard or keypadLV_INDEV_TYPE_ENCODERencoder with left/right turn and push optionsLV_INDEV_TYPE_BUTTONexternal 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.