MTK键盘锁和解锁的问题:
OK+#键加锁的问题:
标志变量:
IdleAppDef.h:
结构体:idle_context_struct中添加:
#if defined (__MMI_KEYPAD_LOCK_PATTERN__)
U8 ToMainMenuScrFromIdleApp;
#endif
IdleApp.c:
赋初始值:
idle_context_struct g_idle_context =
0,/* ToMainMenuScrFromIdleApp */
MainMenu.c
进入主菜单变量赋值:
EntryMainMenuFromIdleScreen
g_idle_context.ToMainMenuScrFromIdleApp = 1;
进入飞行模式主菜单赋值:
EntryScrSimOptionMenu
g_idle_context.ToMainMenuScrFromIdleApp = 1;
通过变量值,进入操作:
goto_main_menu
if (g_idle_context.ToMainMenuScrFromIdleApp == 1)
{
StartTimer(KEYPAD_LOCK_TIMER, KEYPAD_LOCK_TIMEOUT, IdleHandleKeypadLockProcess);//启动定时器,对条件变量重新赋值
SetKeyHandler(IdleHandlePoundKeyForKeypadLock, KEY_STAR, KEY_EVENT_UP);//触发#按键处理,直接锁没有提示
//上面一行若换成下面这个:
SetKeyHandler(IdleSetKeyPadLockFlag, KEY_POUND, KEY_EVENT_UP);
//触发#按键处理,并有lock锁提示
}
过了KEYPAD_LOCK_TIMEOUT时间之后,重新对标志变量赋值0:
void IdleHandleKeypadLockProcess(void)
{
StopTimer(KEYPAD_LOCK_TIMER);
g_idle_context.RskPressedFromIdleApp = 0;
g_idle_context.ToMainMenuScrFromIdleApp = 0;
}
#触发的函数处理:
IdleHandlePoundKeyForKeypadLock
{
if (g_idle_context.ToMainMenuScrFromIdleApp == 0)
{
return;
}
g_idle_context.ToMainMenuScrFromIdleApp = 0;
StopTimer(KEYPAD_LOCK_TIMER);
g_keylock_context.gKeyPadLockFlag = 1;
DisplayIdleScreen()
}
DisplayIdleScreen
{
/* Execute the root history */
ExecuteRootMainHistoryScreen(NULL);
}
EntryIdleScreen
{
if (g_keylock_context.gKeyPadLockFlag == 0) /* keypad is not locked */
else /* Keyapd is locked */
{
mmi_idle_set_keypad_lock_string();//右软键字样设置
mmi_idle_generic_keypad_lock_key_hdlr();
//键盘锁的右软键的绘制字样调用的屏幕
ShowCategory33Screen(
g_keylock_context.KeyLockLSKStringID,
g_keylock_context.KeyLockLSKIconID,
g_keylock_context.KeyLockRSKStringID,//右软键字样
g_keylock_context.KeyLockRSKIconID,
NULL);
mmi_phnset_save_wallpaper_to_speedup();
}
锁键盘的右软键字样Unlock:
mmi_idle_set_keypad_lock_string
{
g_keylock_context.KeyLockRSKStringID = KEYPAD_LOCKED_RSK_TEXT;
}
退出主菜单,对变量赋值
exit_main_menu
{
g_idle_context.ToMainMenuScrFromIdleApp = 0;
}
函数调用栈关系:
EntryIdleScreen()
mmi_frm_go_back_to_history_int()
ExecuteRootMainHistoryScreen()
DisplayIdleScreen()
IdleHandlePoundKeyForKeypadLock()
idle界面键盘锁的问题:
END键+#键:
mmi_idle_entry_idle_screen和EntryFlightModeIdleScreen
{
#if defined(__NEOTEL_MANUAL_STAR_KEY_LOCK__) || defined (__NEOTEL_MANUAL_POUND_KEY_LOCK__)
SetIdlePressEndKeyStatus(FALSE);
SetKeyHandler(HandleIdlePressDownEndKey,KEY_END,KEY_EVENT_DOWN);
SetKeyHandler(EntryScrManualLock,KEY_END,KEY_EVENT_UP);
#endif
/
mmi_idle_set_handler();
ClearKeyEvents();
}