From: InHong Han Date: Tue, 11 Oct 2016 10:19:30 +0000 (+0900) Subject: Fix key event issue in remote input X-Git-Tag: accepted/tizen/common/20161018.175456~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e02f8473977b52b4cb9a84a3fa1a7475af31e9f6;p=platform%2Fcore%2Fuifw%2Fisf.git Fix key event issue in remote input Change-Id: Id3346475e223a3afb273a8bd67fc2fd59e0b40f3 --- diff --git a/ism/extras/efl_panel/remote_input.cpp b/ism/extras/efl_panel/remote_input.cpp index 4fb528e..f3c1665 100644 --- a/ism/extras/efl_panel/remote_input.cpp +++ b/ism/extras/efl_panel/remote_input.cpp @@ -438,17 +438,18 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message) int e = atoi(message.values.at(0).c_str()); LOGD("send_key_event key num : %d", e); - for (unsigned int i = 0; i < REMOTE_KEY_NAMES; i++) { - if (remote_key_names[i].value == e) { - if (remote_key_names[i].value < REMOTE_KEY_TV_POWER) { - _info_manager->remoteinput_forward_key_event(KeyEvent((char *)remote_key_names[i].name)); - } else { + if (e < REMOTE_KEY_TV_POWER) { + _info_manager->remoteinput_forward_key_event(KeyEvent(remote_key_codes[e].code)); + } else { + for (unsigned int i = 0; i < REMOTE_KEY_NAMES; i++) { + if (remote_key_names[i].value == e) { int keycode = keycode_get_from_string((char *)remote_key_names[i].name); if (keycode) panel_send_uinput_event_for_key(UINPUT_KEYBOARD, keycode); + + break; } - break; } } } diff --git a/ism/extras/efl_panel/remote_input_keycode.h b/ism/extras/efl_panel/remote_input_keycode.h index dd7f505..db7f7cb 100644 --- a/ism/extras/efl_panel/remote_input_keycode.h +++ b/ism/extras/efl_panel/remote_input_keycode.h @@ -37,26 +37,36 @@ enum Remote_KeyCode REMOTE_KEY_TV_SWITCHMODE = 117, }; +struct _RemoteInputKeyCode +{ + int value; + int code; +}; + struct _RemoteInputKeyName { int value; const char *name; }; +static _RemoteInputKeyCode remote_key_codes [] = +{ + {REMOTE_KEY_ENTER, SCIM_KEY_Return}, + {REMOTE_KEY_SPACE, SCIM_KEY_KP_Space}, + {REMOTE_KEY_BACKSPACE, SCIM_KEY_BackSpace}, + {REMOTE_KEY_ESCAPE, SCIM_KEY_Escape}, + {REMOTE_KEY_UP, SCIM_KEY_Up}, + {REMOTE_KEY_DOWN, SCIM_KEY_Down}, + {REMOTE_KEY_LEFT, SCIM_KEY_Left}, + {REMOTE_KEY_RIGHT, SCIM_KEY_Right}, + {REMOTE_KEY_PAGE_UP, SCIM_KEY_Page_Up}, + {REMOTE_KEY_PAGE_DOWN, SCIM_KEY_Page_Down}, + {REMOTE_KEY_SELECT, SCIM_KEY_Select}, + {REMOTE_KEY_CANCEL, SCIM_KEY_Cancel}, +}; + static _RemoteInputKeyName remote_key_names [] = { - {REMOTE_KEY_ENTER, "SCIM_KEY_Return"}, - {REMOTE_KEY_SPACE, "SCIM_KEY_KP_Space"}, - {REMOTE_KEY_BACKSPACE, "SCIM_KEY_BackSpace"}, - {REMOTE_KEY_ESCAPE, "SCIM_KEY_Escape"}, - {REMOTE_KEY_UP, "SCIM_KEY_Up"}, - {REMOTE_KEY_DOWN, "SCIM_KEY_Down"}, - {REMOTE_KEY_LEFT, "SCIM_KEY_Left"}, - {REMOTE_KEY_RIGHT, "SCIM_KEY_Right"}, - {REMOTE_KEY_PAGE_UP, "SCIM_KEY_Page_Up"}, - {REMOTE_KEY_PAGE_DOWN, "SCIM_KEY_Page_Down"}, - {REMOTE_KEY_SELECT, "SCIM_KEY_Select"}, - {REMOTE_KEY_CANCEL, "SCIM_KEY_Cancel"}, {REMOTE_KEY_TV_POWER, "XF86PowerOff"}, {REMOTE_KEY_TV_HOME, "XF86Home"}, {REMOTE_KEY_TV_MENU, "XF86SysMenu"},