void *data;
};
-struct _E_Input_Method_Keymap_Info
-{
- const char *language;
- const char *rules;
- const char *models;
- const char *layout;
-};
-
/* This represents the overall input panel's state including the candidate area */
enum _E_Input_Panel_State
{
static Ecore_Event_Handler *ecore_key_down_handler = NULL;
static Eina_List *handlers = NULL;
static uint32_t g_text_input_count = 1;
-static uint32_t g_keymap_index = 0;
-static Eina_Bool g_keyboard_mode_engligh = EINA_TRUE;
static Ecore_Timer *g_timer_will_hide = NULL;
static enum _E_Input_Panel_State g_input_panel_state = E_INPUT_PANEL_STATE_DID_HIDE;
static E_Client *client_surface_ec = NULL;
} \
while (0)
-static struct _E_Input_Method_Keymap_Info g_keymap_info[] = {
- {"en_US", "evdev", "pc105", "us"},
- {"ru_RU", "evdev", "pc105", "ru"},
-};
-
static void _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource *resource);
static void _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method, Eina_Bool need_focus_in);
static Eina_Bool _e_text_input_method_create_context(struct wl_client *client, E_Input_Method *input_method, E_Text_Input *text_input, Eina_Bool need_focus_out);
}
}
-static void
-_display_language_changed_cb(keynode_t *key, void* data)
-{
- int loop;
- char *language = vconf_keynode_get_str(key);
- LOGD("language : %s\n", language);
-
- /* Just in case we did not find any matching language string */
- g_keymap_index = 0;
- if (language)
- {
- for (loop = 0; loop < sizeof(g_keymap_info) / sizeof(struct _E_Input_Method_Keymap_Info); loop++)
- {
- if (strncmp(language, g_keymap_info[loop].language, strlen(g_keymap_info[loop].language)) == 0)
- {
- g_keymap_index = loop;
- }
- }
- }
- /* We do not want to change the current keymap related behavior in TV profile for now */
- if (!_TV)
- {
- /* Resetting the H/W keyboard language mode to English, would be more appropriate when the
- * display language gets changed, such as the cases like changing from French to Russian, for example */
- e_comp_wl_input_keymap_set(g_keymap_info[0].rules, g_keymap_info[0].models, g_keymap_info[0].layout, NULL, NULL, NULL, NULL);
- }
- g_keyboard_mode_engligh = EINA_TRUE;
-}
#if ENABLE_GRAB_KEYBOARD
static void
}
static Eina_Bool
-_e_text_input_method_context_filter_hotkeys(E_Input_Method_Context *context, Ecore_Event_Key *ev)
-{
- if (!ev) return EINA_FALSE;
- if (!context) return EINA_FALSE;
-
- /* We do not want to change the current keymap related behavior in TV profile for now */
- if (!_TV)
- {
- const char *keyname_space = "space";
- if ((strncmp(ev->keyname, keyname_space, strlen(keyname_space)) == 0) && (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT))
- {
- int keymap_index;
- keymap_index = g_keyboard_mode_engligh ? g_keymap_index : 0;
- e_comp_wl_input_keymap_set(g_keymap_info[keymap_index].rules, g_keymap_info[keymap_index].models, g_keymap_info[keymap_index].layout, NULL, NULL, NULL, NULL);
- wl_keyboard_send_keymap(context->kbd.resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
- e_comp_wl->xkb.fd, e_comp_wl->xkb.size);
- g_keyboard_mode_engligh = !g_keyboard_mode_engligh;
-
- return EINA_TRUE;
- }
- }
- return EINA_FALSE;
-}
-
-static Eina_Bool
_e_text_input_method_context_ecore_cb_key_down(void *data, int ev_type EINA_UNUSED, Ecore_Event_Key *ev)
{
E_Input_Method_Context *context = data;
- if (!_e_text_input_method_context_filter_hotkeys(context, ev))
- {
- _e_text_input_method_context_key_send(context, ev->keycode, ev->timestamp,
- WL_KEYBOARD_KEY_STATE_PRESSED);
- }
+ _e_text_input_method_context_key_send(context, ev->keycode, ev->timestamp,
+ WL_KEYBOARD_KEY_STATE_PRESSED);
return ECORE_CALLBACK_RENEW;
}
E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, _e_text_input_method_context_cb_client_resize, NULL);
vconf_notify_key_changed(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, _keyboard_mode_changed_cb, NULL);
- vconf_notify_key_changed(VCONFKEY_LANGSET, _display_language_changed_cb, NULL);
-
- /* Find the current display language when initializing */
- _display_language_changed_cb(NULL, NULL);
eeze_udev_watch_hander = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD,
EEZE_UDEV_EVENT_REMOVE,
}
vconf_ignore_key_changed(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, _keyboard_mode_changed_cb);
- vconf_ignore_key_changed(VCONFKEY_LANGSET, _display_language_changed_cb);
if (eeze_udev_watch_hander)
{