pKeyDown->compose = pEvent->compose;
pKeyDown->timestamp = pEvent->timestamp;
- if(CheckUSBKeyboardStatus() && pKeyDown->string)//usb keyboard exist
- {
- int key = (int)*pKeyDown->string;
- if(IsFilteredKeyOnUSBMode(GetInputPanelStyle(), key))
- {
- free(pKeyDown);
- return false;
- }
- }
-
const _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle);
if (&source == pControl)
{
+ if(CheckUSBKeyboardStatus() && pKeyDown->string)//usb keyboard exist
+ {
+ const char* key = const_cast<char*>(pKeyDown->string);
+ if(FilterKeyOnUSBMode(GetInputPanelStyle(), key, true) == E_SUCCESS)
+ {
+ free(pKeyDown);
+ return false;
+ }
+ }
+
if (ecore_imf_context_filter_event(__pContext, ECORE_IMF_EVENT_KEY_DOWN, (Ecore_IMF_Event*)pKeyDown) == EINA_TRUE)
{
free(pKeyDown);
pKeyUp->compose = pEvent->compose;
pKeyUp->timestamp = pEvent->timestamp;
+ const _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle);
+
+ if (&source == pControl)
+ {
if(CheckUSBKeyboardStatus() && pKeyUp->string)//usb keyboard exist
{
- int key = (int)*pKeyUp->string;
- if(IsFilteredKeyOnUSBMode(GetInputPanelStyle(), key))
+ const char* key = const_cast<char*>(pKeyUp->string);
+ if(FilterKeyOnUSBMode(GetInputPanelStyle(), key) == E_SUCCESS)
{
free(pKeyUp);
return false;
}
}
- const _Control* pControl = _ControlManager::GetInstance()->GetObject(__controlHandle);
-
- if (&source == pControl)
- {
if (ecore_imf_context_filter_event(__pContext, ECORE_IMF_EVENT_KEY_UP, (Ecore_IMF_Event*)pKeyUp) == EINA_TRUE)
{
free(pKeyUp);
return keyboardNumber;
}
-bool
-_InputConnectionImpl::IsFilteredKeyOnUSBMode(InputPanelStyle style, int key)
+result
+_InputConnectionImpl::FilterKeyOnUSBMode(InputPanelStyle style, const char* key, bool commit)
{
if(!(style == INPUT_PANEL_STYLE_NUMBER_ONLY || style == INPUT_PANEL_STYLE_PHONE_NUMBER || style == INPUT_PANEL_STYLE_IP))
- return false;
+ {
+ return E_INVALID_ARG;
+ }
- int TempKey[20] = {0,};
- const int keyOnNumOnlyStyle[10] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/};
- const int keyOnPhoneNumStyle[13] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/,
+ SysTryReturn(NID_UI, key, E_INVALID_ARG, E_INVALID_ARG, "key is null");
+
+ char TempKey[20] = {0,};
+ const char keyOnNumOnlyStyle[10] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/};
+ const char keyOnPhoneNumStyle[13] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/,
0x2a/***/, 0x2b/*+*/, 0x23/*#*/};
- const int keyOnIPStyle[18] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/,
+ const char keyOnIPStyle[18] = { 0x30/*0*/, 0x31/*1*/, 0x32/*2*/, 0x33/*3*/, 0x34/*4*/, 0x35/*5*/, 0x36/*6*/, 0x37/*7*/, 0x38/*8*/, 0x39/*9*/,
0x3a/*:*/, 0x2e/*.*/, 0x61/*a*/, 0x62/*b*/, 0x63/*c*/, 0x64/*d*/, 0x65/*e*/, 0x66/*f*/};
bool isExist = false;
int keyCount = 0;
if(style == INPUT_PANEL_STYLE_NUMBER_ONLY)
{
keyCount = 10;
- memcpy(TempKey, keyOnNumOnlyStyle, keyCount*sizeof(int));
+ memcpy(TempKey, keyOnNumOnlyStyle, keyCount*sizeof(char));
}
else if(style == INPUT_PANEL_STYLE_PHONE_NUMBER)
{
keyCount = 13;
- memcpy(TempKey, keyOnPhoneNumStyle, keyCount*sizeof(int));
+ memcpy(TempKey, keyOnPhoneNumStyle, keyCount*sizeof(char));
}
else if(style == INPUT_PANEL_STYLE_IP)
{
keyCount = 18;
- memcpy(TempKey, keyOnIPStyle, keyCount*sizeof(int));
+ memcpy(TempKey, keyOnIPStyle, keyCount*sizeof(char));
}
- if(!keyCount)
- return false;
-
- for(int i = 0; i < keyCount ; i++)
+ for (int i = 0; i < keyCount ; i++)
{
- if(TempKey[i] == key)
+ if(TempKey[i] == key[0])
+ {
isExist = true;
+ break;
+ }
}
- return !isExist;
+ if (isExist == true && commit == true)
+ {
+ String commitText(key);
+ if (commitText.GetLength() > 1)
+ {
+ return E_SUCCESS;
+ }
+ InputConnection* pInputConnection = GetInputConnection();
+ IInputConnectionEventListener* pListener = GetInputConnectionListener();
+ IInputConnectionEventListenerF* pListenerF = GetInputConnectionListenerF();
+ if (pListener)
+ {
+ pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+ }
+ if (pListenerF)
+ {
+ pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+ }
+ }
+
+ return E_SUCCESS;
}
void