diff --git a/Power_Pico/User/GUI/common/lv_lib_pm.c b/Power_Pico/User/GUI/common/lv_lib_pm.c index 2c7e585..57f790c 100644 --- a/Power_Pico/User/GUI/common/lv_lib_pm.c +++ b/Power_Pico/User/GUI/common/lv_lib_pm.c @@ -107,10 +107,10 @@ Page_t* lv_lib_pm_get_current_page(void) { * 处理按键事件,调用当前页面的按键事件处理函数 * @param key_id 按键ID */ -void lv_lib_pm_handle_key_event(uint8_t key_id) { +void lv_lib_pm_handle_key_event(void* key_event) { Page_t* current_page = lv_lib_pm_get_current_page(); if (current_page && current_page->key_event_handler) { - current_page->key_event_handler(key_id); // 调用当前页面的按键事件处理函数 + current_page->key_event_handler(key_event); // 调用当前页面的按键事件处理函数 } else { LV_LOG_WARN("No key event handler for current page\n"); } diff --git a/Power_Pico/User/GUI/common/lv_lib_pm.h b/Power_Pico/User/GUI/common/lv_lib_pm.h index 2e4f796..244f200 100644 --- a/Power_Pico/User/GUI/common/lv_lib_pm.h +++ b/Power_Pico/User/GUI/common/lv_lib_pm.h @@ -11,7 +11,7 @@ typedef struct { void (*init)(void); void (*deinit)(void); lv_obj_t** page_obj; // 指向页面对象指针的指针 - void (*key_event_handler)(uint8_t key_id); // 按键事件处理函数 + void (*key_event_handler)(void* key_event); // 按键事件处理函数 const char* name; // 可选:用于调试 } Page_t; @@ -33,6 +33,6 @@ void lv_lib_pm_next(void); void lv_lib_pm_prev(void); void lv_lib_pm_goto(uint8_t index); Page_t* lv_lib_pm_get_current_page(void); -void lv_lib_pm_handle_key_event(uint8_t key_id); +void lv_lib_pm_handle_key_event(void* key_event); #endif // PAGE_MANAGER_H