diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2016-05-11 15:38:07 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2016-06-02 11:39:25 +0900 |
commit | 81bbd853e9f594f4cf42661e062535c7b98fa267 (patch) | |
tree | 405ea6997b52e0986c39b19e3b95d557f98b5986 /ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp | |
parent | 7f820628268f1879e6cceda36e3e30e2925ff1f1 (diff) | |
download | isf-81bbd853e9f594f4cf42661e062535c7b98fa267.tar.gz isf-81bbd853e9f594f4cf42661e062535c7b98fa267.tar.bz2 isf-81bbd853e9f594f4cf42661e062535c7b98fa267.zip |
Support to switch between H/W and S/W keyboard mode
Until 2.x, X property was used, vconf will be used instead of X property since 3.0.
Change-Id: I291b2805efd580f2a2e15052282ef1da827791d2
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
Diffstat (limited to 'ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp')
-rw-r--r-- | ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp b/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp index 97cdcccd..2ec97157 100644 --- a/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp +++ b/ism/modules/panelagent/wayland/isf_wsc_control_ui.cpp @@ -26,8 +26,13 @@ #define Uses_SCIM_CONFIG_PATH /* IM control UI part */ +#include "scim_private.h" + #include <Ecore_Wayland.h> #include <Ecore_IMF.h> +#ifdef HAVE_VCONF +#include <vconf.h> +#endif #include "scim.h" #include "isf_wsc_control_ui.h" @@ -56,6 +61,19 @@ static int _get_context_id (WSCContextISF *ctx) return context_scim->id; } +#ifdef HAVE_VCONF +static void keyboard_mode_changed_cb (keynode_t *key, void* data) +{ + int val; + if (vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) != 0) { + LOGW ("Failed to get input detect\n"); + return; + } + + kbd_mode = (TOOLBAR_MODE_T)!val; +} +#endif + TOOLBAR_MODE_T get_keyboard_mode () { return kbd_mode; @@ -64,10 +82,17 @@ TOOLBAR_MODE_T get_keyboard_mode () void isf_wsc_input_panel_init (void) { _support_hw_keyboard_mode = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_SUPPORT_HW_KEYBOARD_MODE), _support_hw_keyboard_mode); + +#ifdef HAVE_VCONF + vconf_notify_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb, NULL); +#endif } void isf_wsc_input_panel_shutdown (void) { +#ifdef HAVE_VCONF + vconf_ignore_key_changed (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, keyboard_mode_changed_cb); +#endif } void isf_wsc_context_input_panel_show (WSCContextISF* wsc_ctx) @@ -82,11 +107,6 @@ void isf_wsc_context_input_panel_show (WSCContextISF* wsc_ctx) if (!wsc_ctx || !wsc_ctx->ctx) return; - if (kbd_mode == TOOLBAR_KEYBOARD_MODE) { - LOGD ("H/W keyboard is existed.\n"); - return; - } - /* set password mode */ iseContext.password_mode = wsc_context_input_panel_password_mode_get (wsc_ctx); |