Support language changes using H/W keyboard 11/259211/3
authorInHong Han <inhong1.han@samsung.com>
Wed, 2 Jun 2021 07:17:25 +0000 (16:17 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 2 Jun 2021 10:11:21 +0000 (19:11 +0900)
Change-Id: I189fd3b67e4906db7f80bf9063023e4920e86a84

CMakeLists.txt
packaging/ise-default.spec
src/ise.cpp

index 5261262..ac1cf11 100644 (file)
@@ -103,6 +103,7 @@ SET(PKGS_CHECK_MODULES
         bundle
         rpc-port
         capi-appfw-event
+        notification
         )
 
 IF (with_cbhm)
index 9ad0501..0b6adab 100644 (file)
@@ -35,6 +35,7 @@ BuildRequires:  pkgconfig(json-glib-1.0)
 BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(rpc-port)
 BuildRequires:  pkgconfig(capi-appfw-event)
+BuildRequires:  pkgconfig(notification)
 Requires:       ise-engine-glm
 Requires:       ise-engine-default
 
index 7c850da..1d80c7c 100644 (file)
@@ -31,6 +31,7 @@
 #include <app_control.h>
 #include <app_preference.h>
 #include <ode/internal-encryption.h>
+#include <notification.h>
 #include "clipboard.h"
 #include "autofill.h"
 #include "ise.h"
@@ -3066,10 +3067,26 @@ static bool ime_app_process_key_event_cb(ime_key_code_e keycode, ime_key_mask_e
         key.dev_subclass = dev_subclass;
     }
 
-    if (keyboard_state->visible_state)
+    if (keyboard_state->visible_state) {
         ise_process_key_event(key, ret);
-    else
-        ret = FALSE;
+    } else {
+        if (key.code == IME_KEY_space && (key.mask & IME_KEY_MASK_SHIFT)) {
+            if (key.mask & IME_KEY_MASK_RELEASED) {
+                if (_language_manager.select_next_language()) {
+                    LANGUAGE_INFO *info = _language_manager.get_language_info(_language_manager.get_current_language());
+                    if (info) {
+                        notification_status_message_post(info->display_name.c_str());
+                    }
+                } else {
+                    LOGE("Failed to change language");
+                }
+            }
+
+            ret = TRUE;
+        } else {
+            ret = FALSE;
+        }
+    }
 
     if (dev_name)
         free(dev_name);