diff options
author | Antoine Villeret <antoine.villeret+dev@gmail.com> | 2024-08-13 04:20:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-13 10:20:15 +0800 |
commit | 90cfb6c61ba612e89afbbad79cdd34f08e724d91 (patch) | |
tree | 81fb2e1d903b32aaef6c6ea46f943daf47741f91 | |
parent | 83582f6a3a7fd704937ad674a091e043c39053ef (diff) | |
download | lvgl-90cfb6c61ba612e89afbbad79cdd34f08e724d91.tar.gz lvgl-90cfb6c61ba612e89afbbad79cdd34f08e724d91.zip |
feat(indev): add long press time setter (#6664)
-rw-r--r-- | src/indev/lv_indev.c | 7 | ||||
-rw-r--r-- | src/indev/lv_indev.h | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/indev/lv_indev.c b/src/indev/lv_indev.c index 016a2f3c6..340688431 100644 --- a/src/indev/lv_indev.c +++ b/src/indev/lv_indev.c @@ -360,6 +360,13 @@ void lv_indev_set_display(lv_indev_t * indev, lv_display_t * disp) indev->disp = disp; } +void lv_indev_set_long_press_time(lv_indev_t * indev, uint16_t long_press_time) +{ + if(indev == NULL) return; + + indev->long_press_time = long_press_time; +} + void * lv_indev_get_user_data(const lv_indev_t * indev) { if(indev == NULL) return NULL; diff --git a/src/indev/lv_indev.h b/src/indev/lv_indev.h index c7206edb6..991407b64 100644 --- a/src/indev/lv_indev.h +++ b/src/indev/lv_indev.h @@ -146,6 +146,13 @@ void lv_indev_set_driver_data(lv_indev_t * indev, void * driver_data); void lv_indev_set_display(lv_indev_t * indev, struct lv_display_t * disp); /** + * Set long press time to the indev + * @param indev pointer to an input device + * @param time long press time in ms + */ +void lv_indev_set_long_press_time(lv_indev_t * indev, uint16_t long_press_time); + +/** * Get the type of an input device * @param indev pointer to an input device * @return the type of the input device from `lv_hal_indev_type_t` (`LV_INDEV_TYPE_...`) |