From 9c7fcdaf19e1fb8dc29f8af9de5279fa5859513e Mon Sep 17 00:00:00 2001 From: qinshijing <51692568+qinshijing@users.noreply.github.com> Date: Mon, 7 Aug 2023 05:19:33 +0800 Subject: [PATCH] feat(indev): change the feedback callback parameter to lv_event_t* (#4435) Signed-off-by: qinshijing Co-authored-by: qinshijing --- src/core/lv_obj_event.c | 2 +- src/indev/lv_indev_private.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/lv_obj_event.c b/src/core/lv_obj_event.c index bfdb3df9a..dfb3edd6b 100644 --- a/src/core/lv_obj_event.c +++ b/src/core/lv_obj_event.c @@ -292,7 +292,7 @@ static lv_res_t event_send_core(lv_event_t * e) /*Call the input device's feedback callback if set*/ lv_indev_t * indev_act = lv_indev_get_act(); if(indev_act) { - if(indev_act->feedback_cb) indev_act->feedback_cb(indev_act, e->code); + if(indev_act->feedback_cb) indev_act->feedback_cb(indev_act, e); if(e->stop_processing) return LV_RES_OK; if(e->deleted) return LV_RES_INV; } diff --git a/src/indev/lv_indev_private.h b/src/indev/lv_indev_private.h index e4ce98acd..924da7310 100644 --- a/src/indev/lv_indev_private.h +++ b/src/indev/lv_indev_private.h @@ -23,6 +23,7 @@ extern "C" { **********************/ struct _lv_indev_t; +struct _lv_event_t; struct _lv_indev_t { /**< Input device type*/ @@ -32,8 +33,8 @@ struct _lv_indev_t { lv_indev_read_cb_t read_cb; /** Called when an action happened on the input device. - * The second parameter is the event from `lv_event_t`*/ - void (*feedback_cb)(struct _lv_indev_t * indev, uint8_t event_code); + * The second parameter is the event structure pointer*/ + void (*feedback_cb)(struct _lv_indev_t * indev, struct _lv_event_t * e); lv_indev_state_t state; /**< Current state of the input device.*/