* 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)
* 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,
char **keycompose,
unsigned int *modifiers)
{
+ WCHAR buf[3];
char delete_string[2] = { 0x7f, 0 };
char *kn = NULL;
char *ks = NULL;
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);