Lines Matching +full:- +full:- +full:exit +full:- +full:code
15 .. code-block:: c
19 lv_indev_set_type(indev, LV_INDEV_TYPE_...); /* Touch pad is a pointer-like device. */
27 - :cpp:enumerator:`LV_INDEV_TYPE_POINTER`: touchpad or mouse
28 - :cpp:enumerator:`LV_INDEV_TYPE_KEYPAD`: keyboard or keypad
29 - :cpp:enumerator:`LV_INDEV_TYPE_ENCODER`: encoder with left/right turn and push options
30 - :cpp:enumerator:`LV_INDEV_TYPE_BUTTON`: external buttons virtually pressing the screen
37 Touchpad, Touch-Screen, Mouse or Any Pointer
38 --------------------------------------------
41 category. Here is an example of a simple input-device Read Callback function:
43 .. code-block:: c
51 data->point.x = touchpad_x;
52 data->point.y = touchpad_y;
53 data->state = LV_INDEV_STATE_PRESSED;
55 data->state = LV_INDEV_STATE_RELEASED;
67 .. code-block:: c
91 .. code-block:: c
124 prevent LVGL sending further input-device-related events.
138 an extension of the pointer input device. Just set ``data->diff`` to the number of
141 Non-editable widgets are scrolled and for editable widgets the event is sent.
147 1. in the input device by the ``indev->rotary_sensitivity`` element (1/256 unit), and
159 Multi-touch gestures
162 LVGL has the ability to recognize multi-touch gestures, when a gesture
167 To enable the multi-touch gesture recognition set the
182 .. code-block::
227 ------------------
238 - Register a Read Callback function for your device and set its type to
240 - Create a Widget Group (``lv_group_t * g = lv_group_create()``) and add Widgets to
242 - Assign the group to an input device: :cpp:expr:`lv_indev_set_group(indev, g)`.
243 - Use ``LV_KEY_...`` to navigate among the Widgets in the group. See
246 .. code-block:: c
253 data->key = last_key(); /* Get the last pressed or released key */
255 if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
256 else data->state = LV_INDEV_STATE_RELEASED;
261 -------
269 2. oong-press of its button,
275 - By turning the encoder you can focus on the next/previous object.
276 - When you press the encoder on a simple object (like a button), it will be clicked.
277 - If you press the encoder on a complex object (like a list, message box, etc.)
280 - To leave edit mode, long press the button.
284 .. code-block:: c
291 data->enc_diff = enc_get_new_moves();
293 if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED;
294 else data->state = LV_INDEV_STATE_RELEASED;
301 -------------
336 - :cpp:enumerator:`LV_KEY_NEXT`: Move focus to next object
337 - :cpp:enumerator:`LV_KEY_PREV`: Move focus to previous object
338 - :cpp:enumerator:`LV_KEY_ENTER`: Triggers :cpp:enumerator:`LV_EVENT_PRESSED`, :cpp:enumerator:`LV_…
339 - :cpp:enumerator:`LV_KEY_UP`: Increase value or move up
340 - :cpp:enumerator:`LV_KEY_DOWN`: Decrease value or move down
341 - :cpp:enumerator:`LV_KEY_RIGHT`: Increase value or move to the right
342 - :cpp:enumerator:`LV_KEY_LEFT`: Decrease value or move to the left
343 - :cpp:enumerator:`LV_KEY_ESC`: Close or exit (e.g. close a :ref:`Drop-Down List <lv_dropdown>`)
344 - :cpp:enumerator:`LV_KEY_DEL`: Delete (e.g. a character on the right in a :ref:`Text Area <lv_text…
345 - :cpp:enumerator:`LV_KEY_BACKSPACE`: Delete (e.g. a character on the left in a :ref:`Text Area <lv…
346 - :cpp:enumerator:`LV_KEY_HOME`: Go to the beginning/top (e.g. in a :ref:`Text Area <lv_textarea>`)
347 - :cpp:enumerator:`LV_KEY_END`: Go to the end (e.g. in a :ref:`Text Area <lv_textarea>`)
351 - :cpp:enumerator:`LV_KEY_NEXT`
352 - :cpp:enumerator:`LV_KEY_PREV`
353 - :cpp:enumerator:`LV_KEY_ENTER`
354 - :cpp:enumerator:`LV_KEY_UP`
355 - :cpp:enumerator:`LV_KEY_DOWN`
356 - :cpp:enumerator:`LV_KEY_LEFT`
357 - :cpp:enumerator:`LV_KEY_RIGHT`
401 -------
426 - :cpp:enumerator:`LV_KEY_ENTER`: will simulate press or pushing of the encoder button.
427 - :cpp:enumerator:`LV_KEY_LEFT`: will simulate turning encoder left.
428 - :cpp:enumerator:`LV_KEY_RIGHT`: will simulate turning encoder right.
429 - other keys will be passed to the focused widget.
434 .. code-block:: c
442 data->key = last_key(); /* Get the last pressed or released key */
444 if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
446 data->state = LV_INDEV_STATE_RELEASED;
448 data->enc_diff = enc_get_new_moves();
454 ---------------
469 .. code-block:: c
478 …if(btn_pr >= 0) { /* Is there a button press? (E.g. -1 indicated no button was press…
480 data->state = LV_INDEV_STATE_PRESSED; /* Set the pressed state */
482 data->state = LV_INDEV_STATE_RELEASED; /* Set the released state */
485 data->btn_id = last_btn; /* Save the last button */
488 When the ``button_read`` callback in the example above changes the ``data->btn_id`` to ``0``
498 ----------
502 - ``scroll_limit`` Number of pixels to slide before actually scrolling the Widget
503 - ``scroll_throw`` Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down.
504 - ``long_press_time`` Press time to send :cpp:enumerator:`LV_EVENT_LONG_PRESSED` (in milliseconds)
505 - ``long_press_repeat_time`` Interval of sending :cpp:enumerator:`LV_EVENT_LONG_PRESSED_REPEAT` (in…
506 - ``read_timer`` pointer to the ``lv_timer`` which reads the input device. Its parameters
511 --------
519 ----------------
528 ``data->continue_reading`` flag will tell LVGL there is more data to
531 Switching the Input Device to Event-Driven Mode
532 -----------------------------------------------
541 .. code-block:: c
553 .. note:: For devices in event-driven mode, `data->continue_reading` is ignored.
558 …- `lv_port_indev_template.c <https://github.com/lvgl/lvgl/blob/master/examples/porting/lv_port_ind…
559 for a template for your own Input-Device driver.