From 341e8cf9bb74fac0a4a58135f9ee79200b3691a6 Mon Sep 17 00:00:00 2001 From: Wonkeun Oh Date: Tue, 10 Jun 2014 20:47:53 +0900 Subject: [PATCH] added condition for changing keyboard mode by focus move Change-Id: I4136800ea3d85aa5180c8c2315f2db2600232cfe --- ism/configs/global | 1 + ism/extras/efl_immodule/isf_imf_context.cpp | 23 +++++++++++++++++++++++ ism/src/scim_config_path.h | 1 + 3 files changed, 25 insertions(+) diff --git a/ism/configs/global b/ism/configs/global index d9c72c1..5f0e447 100755 --- a/ism/configs/global +++ b/ism/configs/global @@ -14,4 +14,5 @@ /PreloadKeyboardIse = true /LaunchIseOnRequest = false /ChangeKeyboardModeByTouch = false +/ChangeKeyboardModeByFocusMove = false /SupportHWKeyboardMode = false diff --git a/ism/extras/efl_immodule/isf_imf_context.cpp b/ism/extras/efl_immodule/isf_imf_context.cpp index 7311155..6c60136 100644 --- a/ism/extras/efl_immodule/isf_imf_context.cpp +++ b/ism/extras/efl_immodule/isf_imf_context.cpp @@ -384,6 +384,7 @@ static Ecore_Event_Handler *_key_up_handler static bool _on_the_spot = true; static bool _shared_input_method = false; static bool _change_keyboard_mode_by_touch = false; +static bool _change_keyboard_mode_by_focus_move = false; static bool _support_hw_keyboard_mode = false; static double space_key_time = 0.0; @@ -1434,6 +1435,27 @@ isf_imf_context_focus_in (Ecore_IMF_Context *ctx) isf_imf_context_focus_out (_focused_ic->ctx); } + if (_change_keyboard_mode_by_focus_move) { + TOOLBAR_MODE_T kbd_mode = TOOLBAR_HELPER_MODE; + unsigned int val = 0; + //To get the current keyboard mode + if (ecore_x_window_prop_card32_get (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1) > 0) { + if (val == 1) { + kbd_mode = TOOLBAR_KEYBOARD_MODE; + } else { + kbd_mode = TOOLBAR_HELPER_MODE; + } + } else { + kbd_mode = TOOLBAR_HELPER_MODE; + } + + //if h/w keyboard mode, keyboard mode will be changed to s/w mode when the entry get the focus. + if (kbd_mode == TOOLBAR_KEYBOARD_MODE) { + LOGD ("Keyboard mode is changed H/W->S/W because of focus_in.\n"); + isf_imf_context_set_keyboard_mode (ctx, TOOLBAR_HELPER_MODE); + } + } + bool need_cap = false; bool need_reset = false; bool need_reg = false; @@ -4518,6 +4540,7 @@ reload_config_callback (const ConfigPointer &config) _on_the_spot = config->read (String (SCIM_CONFIG_FRONTEND_ON_THE_SPOT), _on_the_spot); _shared_input_method = config->read (String (SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), _shared_input_method); _change_keyboard_mode_by_touch = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH), _change_keyboard_mode_by_touch); + _change_keyboard_mode_by_focus_move = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_FOCUS_MOVE), _change_keyboard_mode_by_focus_move); _support_hw_keyboard_mode = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_SUPPORT_HW_KEYBOARD_MODE), _support_hw_keyboard_mode); // Get keyboard layout setting diff --git a/ism/src/scim_config_path.h b/ism/src/scim_config_path.h index a14b1fb..f5682c4 100644 --- a/ism/src/scim_config_path.h +++ b/ism/src/scim_config_path.h @@ -91,6 +91,7 @@ namespace scim { #define SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE "/PreloadKeyboardIse" #define SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST "/LaunchIseOnRequest" #define SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH "/ChangeKeyboardModeByTouch" +#define SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_FOCUS_MOVE "/ChangeKeyboardModeByFocusMove" #define SCIM_GLOBAL_CONFIG_SUPPORT_HW_KEYBOARD_MODE "/SupportHWKeyboardMode" #define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT "/isf/hw_keyboard_detect" -- 2.7.4