Modified to send null key event when preedit, commit event is called 49/104349/5
authorInHong Han <inhong1.han@samsung.com>
Tue, 13 Dec 2016 06:52:58 +0000 (15:52 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Mon, 19 Dec 2016 04:22:00 +0000 (20:22 -0800)
Change-Id: Id9a3242f93ae8c4d6bbf818cd942a972b4db0aa0

ism/extras/efl_panel/remote_input.cpp

index 5dfd8f4..cf41a1c 100644 (file)
@@ -456,20 +456,21 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message)
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_LOG]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_LOG]) == 0) {
         if (message.values.size() == 1) {
             LOGD("Web_page LOG: %s", message.values.at(0).c_str());
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_COMMIT_STRING]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_COMMIT_STRING]) == 0) {
         if (message.values.size() == 1) {
             LOGD( "commit_str:|%s|", message.values.at(0).c_str());
             _info_manager->remoteinput_commit_string(utf8_mbstowcs((char*)message.values.at(0).c_str()));
+            _info_manager->remoteinput_forward_key_event(KeyEvent(SCIM_KEY_NullKey, SCIM_KEY_ReleaseMask));
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_UPDATE_PREEDIT_STRING]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_UPDATE_PREEDIT_STRING]) == 0) {
         AttributeList attrs;
         attrs.push_back(Attribute(0, utf8_mbstowcs((char*)message.values.at(0).c_str()).length(), SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_UNDERLINE));
 
@@ -477,12 +478,14 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message)
             int caret = atoi(message.values.at(1).c_str());
             LOGD ("preedit:|%s|, caret = %d", message.values.at(0).c_str(), caret);
             _info_manager->remoteinput_update_preedit_string(utf8_mbstowcs((char*)message.values.at(0).c_str()), attrs, (uint32) caret);
+            _info_manager->remoteinput_forward_key_event(KeyEvent(SCIM_KEY_NullKey, SCIM_KEY_ReleaseMask));
         } else {
             _info_manager->remoteinput_update_preedit_string(L"", attrs, 0);
+            _info_manager->remoteinput_forward_key_event(KeyEvent(SCIM_KEY_NullKey, SCIM_KEY_ReleaseMask));
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_MOUSE_KEY]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_MOUSE_KEY]) == 0) {
         if (message.values.size() == 1) {
             int e = atoi(message.values.at(0).c_str());
             if (e == 555) {
@@ -491,7 +494,7 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message)
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_MOUSE_MOVE]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_MOUSE_MOVE]) == 0) {
         if (message.values.size() == 1) {
             std::size_t tmp_offset = message.values.at(0).find(',');
             int x = atoi(message.values.at(0).substr(0, tmp_offset).c_str());
@@ -500,7 +503,7 @@ void Remote_Input::handle_websocket_message(ISE_MESSAGE &message)
         }
     }
 
-    if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_WHEEL_MOVE]) == 0) {
+    else if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SEND_WHEEL_MOVE]) == 0) {
         if (message.values.size() == 1) {
             std::size_t tmp_offset = message.values.at(0).find(',');
             //int x = atoi(message.values.at(0).substr(0, tmp_offset).c_str());