lv_indev_get_key() added

This commit is contained in:
Gabor Kiss-Vamosi
2018-08-09 07:30:10 +02:00
parent 8105bced11
commit 604ee63096
2 changed files with 18 additions and 0 deletions

View File

@@ -181,6 +181,17 @@ void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point)
}
}
/**
* Get the last key of an input device (for LV_INDEV_TYPE_KEYPAD)
* @param indev pointer to an input device
* @return the last pressed key (0 on error)
*/
uint32_t lv_indev_get_key(const lv_indev_t * indev)
{
if(indev->driver.type != LV_INDEV_TYPE_KEYPAD) return 0;
else return indev->proc.last_key;
}
/**
* Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
* @param indev pointer to an input device

View File

@@ -98,6 +98,13 @@ void lv_indev_set_button_points(lv_indev_t *indev, lv_point_t *points);
*/
void lv_indev_get_point(const lv_indev_t * indev, lv_point_t * point);
/**
* Get the last key of an input device (for LV_INDEV_TYPE_KEYPAD)
* @param indev pointer to an input device
* @return the last pressed key (0 on error)
*/
uint32_t lv_indev_get_key(const lv_indev_t * indev);
/**
* Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
* @param indev pointer to an input device