diff options
author | Chris Michael <cp.michael@samsung.com> | 2013-06-07 15:32:19 +0100 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2013-06-07 15:42:53 +0100 |
commit | 92a649e35bba30eca7d27e8ae3d345df4bafa5f5 (patch) | |
tree | 247ed13d44d744ef7c7cb98fa3171a413f0e9ea6 | |
parent | ff73dd600b4fb2e02e9b9f49bff77f63bdbad7de (diff) | |
download | efl-92a649e35bba30eca7d27e8ae3d345df4bafa5f5.tar.gz |
Modify ecore_wl_input keypress code to handle modifiers Not on every
keypress, but rather Only on they actual modifier event.
Add some printf debugging for Non-Printables like Ctrl, etc
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_input.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 47aa84fdba..e07804a805 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -590,7 +590,6 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN unsigned int code, num; const xkb_keysym_t *syms; xkb_keysym_t sym = XKB_KEY_NoSymbol; - xkb_mod_mask_t mask; char string[32], key[32], keyname[32];// compose[32]; Ecore_Event_Key *e; struct itimerspec ts; @@ -608,20 +607,9 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN if ((!win) || (win->keyboard_device != input) || (!input->xkb.state)) return; - mask = xkb_state_serialize_mods(input->xkb.state, - XKB_STATE_DEPRESSED | XKB_STATE_LATCHED); - - input->modifiers = 0; - - /* The Ecore_Event_Modifiers don't quite match the X mask bits */ - if (mask & input->xkb.control_mask) - input->modifiers |= ECORE_EVENT_MODIFIER_CTRL; - if (mask & input->xkb.alt_mask) - input->modifiers |= ECORE_EVENT_MODIFIER_ALT; - if (mask & input->xkb.shift_mask) - input->modifiers |= ECORE_EVENT_MODIFIER_SHIFT; - num = xkb_key_get_syms(input->xkb.state, code, &syms); + + sym = XKB_KEY_NoSymbol; if (num == 1) sym = syms[0]; memset(key, 0, sizeof(key)); @@ -639,6 +627,14 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN * non-printable characters */ if ((sym == XKB_KEY_Tab) || (sym == XKB_KEY_ISO_Left_Tab)) string[len++] = '\t'; + /* else if ((sym == XKB_KEY_Control_L) || (sym == XKB_KEY_Control_R)) */ + /* string[len++] = '\'; */ + else + { + printf("Non Printable Key\n"); + printf("\tKey: %s\n", key); + printf("\tKeyname: %s\n", keyname); + } } /* FIXME: NB: Start hacking on compose key support */ @@ -685,9 +681,9 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard EINA_UN timerfd_settime(input->repeat.timerfd, 0, &ts, NULL); } - else if ((state) && - ((!input->repeat.key) || - ((keycode) && (keycode != input->repeat.key)))) + else if ((state)) //&& + /* ((!input->repeat.key) || */ + /* ((keycode) && (keycode != input->repeat.key)))) */ { input->repeat.sym = sym; input->repeat.key = keycode; @@ -709,12 +705,26 @@ static void _ecore_wl_input_cb_keyboard_modifiers(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned int serial EINA_UNUSED, unsigned int depressed, unsigned int latched, unsigned int locked, unsigned int group) { Ecore_Wl_Input *input; + xkb_mod_mask_t mask; LOGFN(__FILE__, __LINE__, __FUNCTION__); if (!(input = data)) return; + xkb_state_update_mask(input->xkb.state, depressed, latched, locked, 0, 0, group); + + mask = xkb_state_serialize_mods(input->xkb.state, + XKB_STATE_DEPRESSED | XKB_STATE_LATCHED); + + input->modifiers = 0; + /* The Ecore_Event_Modifiers don't quite match the X mask bits */ + if (mask & input->xkb.control_mask) + input->modifiers |= ECORE_EVENT_MODIFIER_CTRL; + if (mask & input->xkb.alt_mask) + input->modifiers |= ECORE_EVENT_MODIFIER_ALT; + if (mask & input->xkb.shift_mask) + input->modifiers |= ECORE_EVENT_MODIFIER_SHIFT; } static Eina_Bool |