INT32 System_UserKeyFilter(NVTEVT evt, UINT32 paramNum, UINT32 *paramArray)
{
UINT32 key = evt;
if(IN_RANGE_EVENT(key, NVTEVT_KEY_STATUS_START, NVTEVT_KEY_STATUS_END)) //Status class
{
__FUNC_TRACK__;
System_ResetDetCloseLenCount();
System_ResetPowerSaveCount();
#if (STATUSKEY_FUNCTION == ENABLE)
DBG_IND("^Bgroup key event=0x%x
", key);
if(g_bConsumeStatus)
{
g_bConsumeStatus = 0;
}
else
{
UINT32 uiDscMode = Input_Key2Mode(key);
DBG_IND("^YDscMode=0x%x
", uiDscMode);
//FlowMode_OnKeyMode(uiDscMode);
UI_Switch_DscMode(uiDscMode,DSCMODE_SWITCH_FORCE,DSCMODE_SWITCHDIR_DONT_CARE);
}
#endif
return NVTEVT_CONSUME;
}
else if(IN_RANGE_EVENT(key, NVTEVT_KEY_BUTTON_START, NVTEVT_KEY_BUTTON_END)) //Button class
{
//__FUNC_TRACK__;
if(IN_RANGE_EVENT(key, NVTEVT_KEY_PRESS_START, NVTEVT_KEY_PRESS_END)) //Press key
{
__FUNC_TRACK__; //ÁÁÆÁ
if(key == NVTEVT_KEY_POWER)
{
return NVTEVT_CONSUME;
}
System_ResetDetCloseLenCount();
if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1
{
__FUNC_TRACK__;
//NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL,
// because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~
System_ResetPowerSaveCount();
return NVTEVT_CONSUME;
}
else
{
System_ResetPowerSaveCount();
if (m_uiAnyKeyUnlockEn)
{
Ux_PostEvent(NVTEVT_KEY_PRESS_START, 1, key);
return NVTEVT_CONSUME;
}
return NVTEVT_PASS;
}
}
else if(IN_RANGE_EVENT(key, NVTEVT_KEY_CONTINUE_START, NVTEVT_KEY_CONTINUE_END)) //Contine key
{
switch(key) {
//case NVTEVT_KEY_CUSTOM1_CONT:
case NVTEVT_KEY_POWER_CONT:
CheckSetLongKeyFlag();//++
{
__FUNC_TRACK__;
if( Input_GetLongKeyFlag() )
{
__FUNC_TRACK__;
//if(FALSE == MovRec_IsRecording())
{
//²»ÐèÒª¼ì²â°´¼ü¹Ø±ÕÖ®ºó£¬USB½ÓÈëÖØÆô
PowerOffCheckUSB = TRUE;
__POWEROFF_TRACK__;
System_PowerOff(SYS_POWEROFF_NORMAL);
return NVTEVT_CONSUME;
}
}
}
break;
#if(EAE_LOGO==ENABLE)
case NVTEVT_KEY_DOWN_CONT:
CheckSetLongKeyFlag();//++
{
__FUNC_TRACK__;
if( Input_GetLongKeyFlag() )
{
__FUNC_TRACK__;
if((UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0)&&(SysGetFlag(FL_MOVIE_TIMELAPSE_REC)==MOVIE_TIMELAPSEREC_OFF))
//if(UI_GetData(FL_MOVIE_AUTO_PARKING_MODE) != 0)
{
if(get_parking_mode_flag())
app_exit_eae_parking_mode();
else
app_enter_eae_parking_mode();
}
}
}
break;
#endif
#if 0
//case NVTEVT_KEY_SHUTTER1_CONT:
case NVTEVT_KEY_MENU_CONT:
__FUNC_TRACK__;
CheckSetLongKeyFlag();//++
if(1)//FALSE == get_ignore_mode_press())
{
__FUNC_TRACK__;
if(Input_GetLongKeyFlag() && (FALSE == GetLongSetupWifi()))
{
__FUNC_TRACK__;
debug_msg("========= FL_ModeIndex: %d
", UI_GetData(FL_ModeIndex));
if(UI_GetData(FL_ModeIndex) == DSC_MODE_MOVIE) {
//if(!MovRec_IsRecording())
{
debug_msg("========= gMovData.State : %d
", gMovData.State );
if(gMovData.State == MOV_ST_VIEW)
{
g_bRecordLock = FALSE;
SetLongSetupWifi( TRUE );
UIFlowWndMovie_SetupWifi();
}
}
}
else if(UI_GetData(FL_ModeIndex) < DSC_MODE_MOVIE)
{
debug_msg("========= gPhotoData.State : %d
", gPhotoData.State );
if(gPhotoData.State == PHOTO_ST_VIEW)
{
g_bRecordLock = FALSE;
SetLongSetupWifi( TRUE );
UIFlowWndMovie_SetupWifi();
}
}
else
{
}
return NVTEVT_PASS;//NVTEVT_CONSUME;
}
}
else
{
__FUNC_TRACK__;
return NVTEVT_PASS;//NVTEVT_CONSUME;
}
break;
#endif
#if 0
case NVTEVT_KEY_POWER_CONT:
return NVTEVT_CONSUME;
case NVTEVT_KEY_MODE_CONT:
CheckSetLongKeyShutter1Flag();//++
{
__FUNC_TRACK__;
if(Input_GetLongKeyShutter1Flag())
{
__FUNC_TRACK__;
SetLongShutter1KeyFlag(TRUE);
}
}
return NVTEVT_CONSUME;
break;
#endif
}
System_ResetDetCloseLenCount();
System_ResetPowerSaveCount();
return NVTEVT_PASS;
}
else if(IN_RANGE_EVENT(key, NVTEVT_KEY_RELEASE_START, NVTEVT_KEY_RELEASE_END)) //Release key
{
__FUNC_TRACK__; //Ï¢ÆÁ´òÓ¡
set_ignore_mode_press( FALSE );
ClearKeyHoldCount();
ClearKeyShutter1HoldCount();
SetLongShutter1KeyFlag( FALSE );
if(key == NVTEVT_KEY_POWER_REL)
{
System_ResetDetCloseLenCount();
if(GxPower_GetControl(GXPWR_CTRL_SLEEP_LEVEL) > 1) // drop key if sleep level > 1
{
//NOTE! do not set GXPWR_CTRL_SLEEP_RESET before get GXPWR_CTRL_SLEEP_LEVEL,
// because GXPWR_CTRL_SLEEP_LEVEL status maybe alter by sleep wakeup flow~
System_ResetPowerSaveCount();
}
else
{
//debug_msg("==========power_times : %d
", power_times);
{
//#NT#2016/03/07#KCHong -begin
//#NT#Low power timelapse function
#if (TIMELAPSE_LPR_FUNCTION == ENABLE)
MovieTLLPR_Process(TIMELAPSE_FROM_PWRKEY);
#endif
//#NT#2016/03/07#KCHong -end
//System_PowerOff(SYS_POWEROFF_NORMAL);
}
}
return NVTEVT_CONSUME;
}
System_ResetDetCloseLenCount();
System_ResetPowerSaveCount();
return NVTEVT_PASS;
}
}
return NVTEVT_PASS;
}