From dffc613d46082e868aa1b1a54831f9b6abc93309 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 11 Dec 2017 10:59:33 +0100 Subject: [PATCH] indev: add get_inactive_time --- lv_core/lv_indev.c | 10 ++++++++++ lv_core/lv_indev.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/lv_core/lv_indev.c b/lv_core/lv_indev.c index 2515a2a75..c475a52f8 100644 --- a/lv_core/lv_indev.c +++ b/lv_core/lv_indev.c @@ -173,6 +173,16 @@ void lv_indev_get_vect(lv_indev_t * indev, lv_point_t * point) point->y = indev->proc.vect.y; } +/** + * Get elapsed time since last press + * @param indev pointer to an input device + * @return Elapsed ticks (milliseconds) since last press + */ +uint32_t lv_indev_get_inactive_time(lv_indev_t * indev) +{ + return indev->proc.pr_timestamp; +} + /** * Do nothing until the next release * @param indev pointer to an input device diff --git a/lv_core/lv_indev.h b/lv_core/lv_indev.h index 5539fb2e7..7bd497348 100644 --- a/lv_core/lv_indev.h +++ b/lv_core/lv_indev.h @@ -94,6 +94,13 @@ bool lv_indev_is_dragging(lv_indev_t * indev); */ void lv_indev_get_vect(lv_indev_t * indev, lv_point_t * point); +/** + * Get elapsed time since last press + * @param indev pointer to an input device + * @return Elapsed ticks (milliseconds) since last press + */ +uint32_t lv_indev_get_inactive_time(lv_indev_t * indev); + /** * Do nothing until the next release * @param indev pointer to an input device