2 #include "e_kbd_send.h"
5 _string_to_keysym(const char *str)
9 /* utf8 -> glyph id (unicode - ucs4) */
11 evas_string_char_next_get(str, 0, &glyph);
12 if (glyph <= 0) return NULL;
13 /* glyph id -> keysym */
14 if (glyph > 0xff) glyph |= 0x1000000;
15 return ecore_x_keysym_string_get(glyph);
19 e_kbd_send_string_press(const char *str, Kbd_Mod mod)
21 const char *key = NULL;
23 key = _string_to_keysym(str);
25 e_kbd_send_keysym_press(key, mod);
29 e_kbd_send_keysym_press(const char *key, Kbd_Mod mod)
31 if (mod & KBD_MOD_CTRL) ecore_x_test_fake_key_down("Control_L");
32 if (mod & KBD_MOD_ALT) ecore_x_test_fake_key_down("Alt_L");
33 if (mod & KBD_MOD_WIN) ecore_x_test_fake_key_down("Super_L");
34 ecore_x_test_fake_key_press(key);
35 if (mod & KBD_MOD_WIN) ecore_x_test_fake_key_up("Super_L");
36 if (mod & KBD_MOD_ALT) ecore_x_test_fake_key_up("Alt_L");
37 if (mod & KBD_MOD_CTRL) ecore_x_test_fake_key_up("Control_L");