summaryrefslogtreecommitdiff
path: root/hw/xwin/winwndproc.c
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-07-05 17:52:35 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-07-05 17:52:35 +0000
commitd72fef26d44e649f39a56730830148d48d77ee9e (patch)
tree18283342486802e2d2b67cc8b3a256a41fb6234b /hw/xwin/winwndproc.c
parent0f2c8221c938ce8eebd9f0e111a6b87223c18f9e (diff)
Fix simultanious presses of Left and Right Control and Shift keys.
https://bugs.freedesktop.org/show_bug.cgi?id=3677
Diffstat (limited to 'hw/xwin/winwndproc.c')
-rw-r--r--hw/xwin/winwndproc.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 5d9fe14c9..0864fc638 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -42,6 +42,12 @@
#include "winconfig.h"
#include "winmsg.h"
+#ifdef XKB
+extern BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam);
+#endif
+extern void winFixShiftKeys (int iScanCode);
+
+
/*
* Global variables
*/
@@ -1014,11 +1020,22 @@ winWindowProc (HWND hwnd, UINT message,
* Discard presses generated from Windows auto-repeat
* ago: Only discard them if XKB is not disabled
*/
- if (!g_winInfo.xkb.disable)
- {
- if (lParam & (1<<30))
- return 0;
- }
+ if (!g_winInfo.xkb.disable && (lParam & (1<<30)))
+ {
+ switch (wParam)
+ {
+ /* ago: Pressing LControl while RControl is pressed is
+ * Indicated as repeat. Fix this!
+ */
+ case VK_CONTROL:
+ case VK_SHIFT:
+ if (winCheckKeyPressed(wParam, lParam))
+ return 0;
+ break;
+ default:
+ return 0;
+ }
+ }
#endif
/* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */
@@ -1057,6 +1074,10 @@ winWindowProc (HWND hwnd, UINT message,
/* Enqueue a keyup event */
winTranslateKey (wParam, lParam, &iScanCode);
winSendKeyEvent (iScanCode, FALSE);
+
+ /* Release all pressed shift keys */
+ if (wParam == VK_SHIFT)
+ winFixShiftKeys (iScanCode);
return 0;
case WM_HOTKEY: