⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eqtapnumeric.cpp

📁 Symbian平台 数字键盘手机输入法源码
💻 CPP
字号:
// eQTapNumeric.cpp: implementation of the CeQTapNumeric class.
//
//////////////////////////////////////////////////////////////////////

#include "eQTapNumeric.h"
#include "FepControl.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CeQTapNumeric::CeQTapNumeric()
{

}

CeQTapNumeric::~CeQTapNumeric()
{

}
int CeQTapNumeric::OnKeyEventProc(int nParameter1, int nParameter2)
{
	int nReturn = KEY_RESULT_NOTPROCESSED;
	TKeyEvent* aKeyEvent = (TKeyEvent*)nParameter1;
	if((m_bIsIMActive == FALSE)||(aKeyEvent==NULL))
	{
		goto FuncExit;
	}
	
	nReturn = EKeyWasNotConsumed;

	if (aKeyEvent->iCode == '*')
	{
		// Just place a key event ('+') to the application underneath the FEP 
		if (m_peQTapCtrl->IsInlineEditTrans()==FALSE)
		{ 
			m_peQTapCtrl->StartInlineEdit(KNullDesC, 0, ETrue);
		}
		m_peQTapCtrl->SimulateKeyEventL('+');
		nReturn = EKeyWasConsumed;
	}
	else
	{
		if((aKeyEvent->iCode>='0')&&(aKeyEvent->iCode<='9'))
		{
			if (m_peQTapCtrl->IsInlineEditTrans()==FALSE)
			{ 
				m_peQTapCtrl->StartInlineEdit(KNullDesC, 0, ETrue);
			}
			TBuf<1> buffer = KNullDesC();
			buffer.Append(aKeyEvent->iCode);
			m_peQTapCtrl->UpdateInlineEditL(buffer, 1);						
			m_peQTapCtrl->CommitInlineEdit(ETrue);
			nReturn = EKeyWasConsumed;
		}
		/*
		*/
	}

FuncExit:
	return nReturn;
}
int CeQTapNumeric::OnDrawIMWindow()
{
	int nReturn = 0;

	return nReturn;
}

CeQTapNumeric* CeQTapNumeric::NewL(CeQTapControl* pControl)
{
	CeQTapNumeric* self = new(ELeave)CeQTapNumeric(pControl);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::Pop();	// self
	return self;
}

CeQTapNumeric::CeQTapNumeric(CeQTapControl* pControl)
{
	m_peQTapCtrl = pControl;
	m_bIsIMActive = FALSE;
}

void CeQTapNumeric::ConstructL()
{
}

void CeQTapNumeric::SwitchToNumeric()
{
	ActiveNMWindow(FALSE);
}

void CeQTapNumeric::ActiveNMWindow(TBool bActive)
{
	TPoint fepControlPos;
	RWindow& window = m_peQTapCtrl->GetRWindow();

	if (bActive == TRUE)  //打开输入法窗口	
	{
		window.SetVisible(ETrue);
		m_peQTapCtrl->SetWindowVisibleState(TRUE);
	}
	else                 //关闭输入法窗口
	{
		window.SetVisible(EFalse);
		m_peQTapCtrl->SetWindowVisibleState(FALSE);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -