docs(all) Proofread, fix typos and add clarifications in confusing areas (#2528)
Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ indev_drv.read_cb =... /*See below.*/
|
||||
lv_indev_t * my_indev = lv_indev_drv_register(&indev_drv);
|
||||
```
|
||||
|
||||
`type` can be
|
||||
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
|
||||
@@ -75,7 +75,7 @@ void keyboard_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
|
||||
```
|
||||
|
||||
### Encoder
|
||||
With an encoder you can do 4 things:
|
||||
With an encoder you can do the following:
|
||||
1. Press its button
|
||||
2. Long-press its button
|
||||
3. Turn left
|
||||
@@ -84,8 +84,8 @@ With an encoder you can do 4 things:
|
||||
In short, the Encoder input devices work like this:
|
||||
- By turning the encoder you can focus on the next/previous object.
|
||||
- When you press the encoder on a simple object (like a button), it will be clicked.
|
||||
- If you press the encoder on a complex object (like a list, message box, etc.) the object will go to edit mode whereby turning the encoder you can navigate inside the object.
|
||||
- To leave edit mode press long the button.
|
||||
- If you press the encoder on a complex object (like a list, message box, etc.) the object will go to edit mode whereby you can navigate inside the object by turning the encoder.
|
||||
- To leave edit mode, long press the button.
|
||||
|
||||
|
||||
To use an *Encoder* (similarly to the *Keypads*) the objects should be added to groups.
|
||||
@@ -115,7 +115,7 @@ You need to have 3 buttons available:
|
||||
- `LV_KEY_RIGHT` will simulate turning encoder right
|
||||
- other keys will be passed to the focused widget
|
||||
|
||||
If you hold the keys it will simulate encoder click with period specified in `indev_drv.long_press_rep_time`.
|
||||
If you hold the keys it will simulate an encoder advance with period specified in `indev_drv.long_press_rep_time`.
|
||||
|
||||
```c
|
||||
indev_drv.type = LV_INDEV_TYPE_ENCODER;
|
||||
@@ -183,14 +183,14 @@ Besides `read_cb` a `feedback_cb` callback can be also specified in `lv_indev_dr
|
||||
|
||||
|
||||
### Associating with a display
|
||||
Every input device is associated with a display. By default, a new input device is added to the lastly created or the explicitly selected (using `lv_disp_set_default()`) display.
|
||||
Every input device is associated with a display. By default, a new input device is added to the last display created or explicitly selected (using `lv_disp_set_default()`).
|
||||
The associated display is stored and can be changed in `disp` field of the driver.
|
||||
|
||||
### Buffered reading
|
||||
By default, LVGL calls `read_cb` periodically. This way there is a chance that some user gestures are missed.
|
||||
By default, LVGL calls `read_cb` periodically. Because of this intermittent polling there is a chance that some user gestures are missed.
|
||||
|
||||
To solve this you can write an event driven driver for your input device that buffers measured data. In `read_cb` you can set the buffered data instead of reading the input device.
|
||||
You can set the `data->continue_reading` flag to tell that LVGL there is more data to read and it should call the `read_cb` again.
|
||||
To solve this you can write an event driven driver for your input device that buffers measured data. In `read_cb` you can report the buffered data instead of directly reading the input device.
|
||||
Setting the `data->continue_reading` flag will tell LVGL there is more data to read and it should call `read_cb` again.
|
||||
|
||||
## Further reading
|
||||
|
||||
|
||||
Reference in New Issue
Block a user