}
#endif
+static void set_hw_keyboard_input_detect_flag(bool flag)
+{
+#ifdef HAVE_VCONF
+ int input_detect = false;
+
+ if (vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &input_detect) == 0) {
+ if (input_detect != flag) {
+ if (vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, flag) != 0)
+ LOGW ("Failed to set vconf key");
+ else
+ LOGD ("Succeeded to set vconf key");
+ }
+ }
+#endif
+}
+
/**
* @brief Change keyboard mode.
*
unsigned int val = 0;
#endif
-#ifdef HAVE_VCONF
- int input_detect = false;
-#endif
-
String helper_uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String (""));
String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
_support_hw_keyboard_mode = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_SUPPORT_HW_KEYBOARD_MODE), _support_hw_keyboard_mode);
}
#endif
-#ifdef HAVE_VCONF
- vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &input_detect);
-
- if (!input_detect) {
- if (vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 1) != 0)
- LOGW ("Failed to set vconf key");
- else
- LOGD ("Succeeded to set vconf key");
- }
-#endif
+ set_hw_keyboard_input_detect_flag(true);
} else if (mode == TOOLBAR_HELPER_MODE) {
LOGD ("SOFTWARE KEYBOARD MODE");
/* When switching back to S/W keyboard mode, let's hide candidate window first */
delete_notification (&hwkbd_module_noti);
#endif
-#ifdef HAVE_VCONF
- vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &input_detect);
-
- if (input_detect) {
- if (vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0) != 0)
- LOGW ("Failed to set vconf key");
- else
- LOGD ("Succeeded to set vconf key");
- }
-#endif
+ set_hw_keyboard_input_detect_flag(false);
}
_config->reload ();
}