Fixed:Message screen key event can not send to father screen.

This commit is contained in:
xiaojiazhu 2024-01-03 16:48:01 +08:00
parent 94b1d4b7e6
commit 5b0ad73b40
4 changed files with 19 additions and 2 deletions

View File

@ -103,6 +103,7 @@ typedef enum {
#if defined(_UI_STYLE_LVGL_) #if defined(_UI_STYLE_LVGL_)
NVTEVT_UPDATE_LVGL = 0x80000001, ///< Update lvgl task handel NVTEVT_UPDATE_LVGL = 0x80000001, ///< Update lvgl task handel
#endif #endif
NVTEVT_MSG_SCREEN_KEY = 0x80000002,
/* INSERT NEW EVENT HRER */ /* INSERT NEW EVENT HRER */

View File

@ -73,6 +73,7 @@ static BOOL g_PhotoBgInitFileSys = FALSE;
static BOOL g_SysStrg_Chg = FALSE; static BOOL g_SysStrg_Chg = FALSE;
//#NT#2023/11/21#Eric - end //#NT#2023/11/21#Eric - end
static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key);
static void sf_show_send_text(lv_obj_t* obj, const unsigned short status); static void sf_show_send_text(lv_obj_t* obj, const unsigned short status);
static lv_obj_t *g_preview_info_msgbox = NULL; static lv_obj_t *g_preview_info_msgbox = NULL;
static lv_obj_t *g_preview_info_label = NULL; static lv_obj_t *g_preview_info_label = NULL;

View File

@ -2409,7 +2409,6 @@ static void UIFlowPlay_Key(lv_obj_t* obj, uint32_t key)
static void UIFlowPlay_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) static void UIFlowPlay_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
{ {
switch(msg->event) switch(msg->event)
{ {
case NVTEVT_CB_MOVIE_FINISH: case NVTEVT_CB_MOVIE_FINISH:
@ -2481,6 +2480,18 @@ static void UIFlowPlay_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* ms
break; break;
} }
case NVTEVT_MSG_SCREEN_KEY:
if (1 == msg->paramNum)
{
uint32_t key = msg->paramArray[0];
if (SELECTION_SHOW_TURE == gSeletionShow) {
Option_play_Selection_Key(obj, key);
} else {
/* handle key event */
UIFlowPlay_Key(obj, key);
}
}
break;
default: default:
break; break;

View File

@ -325,7 +325,11 @@ void message_box_wrnmsg_OnKey(lv_obj_t* msgbox, uint32_t key)
{ {
// static uint32_t key22 = LV_KEY_END; // static uint32_t key22 = LV_KEY_END;
// key22 = key; // key22 = key;
// lv_event_send(lv_obj_get_parent(UIFlowWrnMsg), LV_USER_EVENT_KEY_RELEASE, &key22); if(lv_plugin_scr_count() >= 2){
lv_event_send(lv_plugin_scr_by_index(lv_plugin_scr_count() - 2), LV_USER_EVENT_NVTMSG, gen_nvtmsg_data(NVTEVT_MSG_SCREEN_KEY, 1, key));
}else{
lv_event_send(lv_plugin_scr_act(), LV_USER_EVENT_NVTMSG, gen_nvtmsg_data(NVTEVT_MSG_SCREEN_KEY, 1, key));
}
return; return;
switch(key) switch(key)
{ {