feat(indev): change the feedback callback parameter to lv_event_t* (#4435)

Signed-off-by: qinshijing <qinshijing@xiaomi.com>
Co-authored-by: qinshijing <qinshijing@xiaomi.com>
This commit is contained in:
qinshijing
2023-08-07 05:19:33 +08:00
committed by GitHub
parent 96cb434a64
commit 9c7fcdaf19
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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;
}
+3 -2
View File
@@ -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.*/