Ecore_Win32 : Fix the key release values for non keystroke keys (Windows XP)

SVN revision: 65695
This commit is contained in:
Vincent Torri 2011-11-29 23:06:01 +00:00
parent f57db57c25
commit 42f0263f49
3 changed files with 29 additions and 3 deletions

View File

@ -355,3 +355,4 @@
* Discard left Ctrl when AltGr is pressed (Windows XP)
* Fix the string value for the Delete key (Windows XP)
* Fix the key release values for non keystroke keys (Windows XP)

View File

@ -132,7 +132,7 @@ _ecore_win32_window_procedure(HWND window,
* we check if the next message
* - is a WM_KEYUP or WM_SYSKEYUP
* - has the same timestamp than the Ctrl one
* - is the key press of the right Alt key
* - is the key release of the right Alt key
*/
res = PeekMessage(&next_msg, data->window,
WM_KEYUP, WM_SYSKEYUP,

View File

@ -650,6 +650,7 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
char **keycompose,
unsigned int *modifiers)
{
WCHAR buf[3];
char delete_string[2] = { 0x7f, 0 };
char *kn = NULL;
char *ks = NULL;
@ -1115,8 +1116,32 @@ _ecore_win32_event_keystroke_get(Ecore_Win32_Callback_Data *msg,
kc = "";
break;
default:
/* other non keystroke characters */
return 0;
{
/* other non keystroke characters */
BYTE kbd_state[256];
int res;
if (is_down)
return 0;
if (!GetKeyboardState(kbd_state))
return 0;
res = ToUnicode(msg->window_param,
MapVirtualKey(msg->window_param, 2),
kbd_state, buf, 3, 0);
if (res == 1)
{
/* FIXME: might be troublesome for non european languages */
/* in that case, UNICODE should be used, I guess */
buf[1] = '\0';
kn = (char *)buf;
ks = (char *)buf;
kc = (char *)buf;
break;
}
return 0;
}
}
*keyname = strdup(kn);