示例#1
0
//KeyId - 按键序号
//KeyStaus - 状态值 0(release) or 1(press)
void ExtiKeyHandler(u8 KeyId,u8 KeyStaus)
{
	INPUT_EVENT EventParam;

	EventParam.uType=SingleNum_Type;
	EventParam.EventType=Input_ExtiKey;
	EventParam.Num=((KeyId+EXTI_KEY_VALUE_START)<<1)+KeyStaus;
	OS_MsgBoxSend(gInputHandler_Queue,&EventParam,100,FALSE);	
}
示例#2
0
文件: UserApi.c 项目: beartan/q-sys
//ת��ijҳ��,���ô˺�����InputHandler���߳�����ɵ�ǰ����󣬻Ὺʼת������
//return TRUE :����ת��
//return FALSE : ������ת��
//ҳ����ҳ��֮��IJ������ݿ���pInfoParamָ��
SYS_MSG Q_GotoPage(PAGE_ACTION PageAction, u8 *Name, int IntParam, void *pSysParam)
{
	INPUT_EVENT InEventParam;
	u8 PageIdx;
	u8 Result;
	
	if(GetCurrPage())
		UA_Debug("%s : %s->%s\n\r",__FUNCTION__,GetCurrPage()->Name,Name);
	else
		UA_Debug("%s : NULL->%s\n\r",__FUNCTION__,Name);
	
	//���Ҷ�Ӧҳ��
	if(PageAction==SubPageReturn) //�������ҳ�淵�أ����ҵ���һ��ҳ��
	{
		gCurrSysMsg=SM_State_OK;
		PageIdx=GetPageIdxByLayerOffset(1);
	}
	else
	{
		gCurrSysMsg=FindPage(Name,0,&PageIdx);//��ʼ��ҳ��ش���Ϣ
		if(gCurrSysMsg!=SM_State_OK)//û�ҵ���Ӧҳ��
		{
			return gCurrSysMsg;
		}
	}

	if(GetPageByIdx(PageIdx)->Type==POP_PAGE)//Ҫ�����ҳ����popҳ��
		if((PageAction!=GotoSubPage)&&(PageAction!=SubPageReturn))
		{
			Q_ErrorStopScreen("Pop Page not allow entry by \"GotoNewPage\" & \"SubPageTranslate\" param!");
			return SM_State_Faile;
		}

	//POPҳ��ֻ��������ҳ�淵�ص���ʽ�˳�
	if((Q_GetPageByTrack(0)->Type==POP_PAGE)&&(PageAction!=SubPageReturn))
	{
		Q_ErrorStopScreen("Pop Page only allow quit by \"SubPageReturn\" param!");
		return SM_State_Faile;
	}

	if(Q_GetPageByTrack(0)->Type!=POP_PAGE) //�����popҳ�淵�أ���ô����Ҫִ�����goto case
		gCurrSysMsg=GetPageByIdx(PageIdx)->SysEvtHandler(Sys_PreGotoPage, IntParam,pSysParam);

	//Debug("GotoPage Return 0x%x\n\r",SysMsg);
	
	if(gCurrSysMsg&SM_NoGoto)//ҳ���Sys_Goto_Page���ݻص���Ϣ
	{//��ҳ���Sys_PreGotoPage���ݻ�SM_NoGoto��Ϣ��ʾ����Ҫ�����ҳ���ˡ�
		return gCurrSysMsg;
	}
	else
	{
		InEventParam.uType=Sync_Type;
		switch(PageAction)
		{
			case GotoNewPage:
				InEventParam.EventType=Input_GotoNewPage;break;
			case GotoSubPage:
				InEventParam.EventType=Input_GotoSubPage;break;
			case SubPageReturn:
				InEventParam.EventType=Input_SubPageReturn;break;
		}
		InEventParam.Num=PageIdx;
		InEventParam.Info.SyncInfo.IntParam=IntParam;
		InEventParam.Info.SyncInfo.pParam=pSysParam;
		//Debug("New Page Index:%d\n\r",PageIdx);
		if((Result=OS_MsgBoxSend(gInputHandler_Queue,&InEventParam,100,FALSE))==OS_ERR_NONE)
		{
			return gCurrSysMsg;
		}
		else
		{
			Debug("GotoPage Send Msg Error!%d\n\r",Result);
			return SM_State_Faile;
		}
	}	
}