void *ev);
static int _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
- Eina_Bool is_down,
- char **keyname,
- char **keysymbol,
- char **keycompose,
- unsigned int *modifiers);
+ Eina_Bool is_down,
+ char **keyname,
+ char **keysymbol,
+ char **keycompose,
+ unsigned int *modifiers);
-static int _ecore_win32_event_char_get(int key,
- char **keyname,
- char **keysymbol,
- char **keycompose);
+static int _ecore_win32_event_char_get(int key,
+ char **keyname,
+ char **keysymbol,
+ char **keycompose,
+ unsigned int *modifiers);
/***** Global functions definitions *****/
if (!_ecore_win32_event_char_get(LOWORD(msg->window_param),
(char **)&e->keyname,
(char **)&e->key,
- (char **)&e->string))
+ (char **)&e->string,
+ &e->modifiers))
{
free(e);
return;
!_ecore_win32_event_char_get(LOWORD(msg->window_param),
(char **)&e->keyname,
(char **)&e->key,
- (char **)&e->string))
+ (char **)&e->string,
+ &e->modifiers))
{
free(e);
return;
ks = "Shift_R";
kc = "";
}
- *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
}
else /* is_up */
{
kc = "";
_ecore_win32_key_mask &= ~ECORE_WIN32_KEY_MASK_RSHIFT;
}
- *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
+ *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
}
break;
}
kn = (char *)buf;
ks = (char *)buf;
kc = (char *)buf;
+
+ res = GetAsyncKeyState(VK_SHIFT);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
+
+ res = GetKeyState(VK_CONTROL);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
+
+ res = GetKeyState(VK_MENU);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_ALT;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
+
break;
}
return 0;
}
static int
-_ecore_win32_event_char_get(int key,
- char **keyname,
- char **keysymbol,
- char **keycompose)
+_ecore_win32_event_char_get(int key,
+ char **keyname,
+ char **keysymbol,
+ char **keycompose,
+ unsigned int *modifiers)
{
char *kn = NULL;
char *ks = NULL;
char *kc = NULL;
char buf[2];
+ SHORT res;
*keyname = NULL;
*keysymbol = NULL;
return 0;
}
+ res = GetAsyncKeyState(VK_SHIFT);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_SHIFT;
+
+ res = GetKeyState(VK_CONTROL);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_CTRL;
+
+ res = GetKeyState(VK_MENU);
+ if (res & 0x8000)
+ *modifiers |= ECORE_EVENT_MODIFIER_ALT;
+ else
+ *modifiers &= ~ECORE_EVENT_MODIFIER_ALT;
+
return 1;
}