summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-01-10 13:10:36 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2005-01-10 13:10:36 +0000
commit11b54c0707a3eef4af1747e1fbd2402df6136982 (patch)
tree1b358e4faac79c8d189469f97b6e605a8230ab21
parent5401caedc32fe8abd7a3ae00d6a83ebbdff8a042 (diff)
winkeybd.h
winkeyhook.c Make keyhook feature work in multiwindowmode too Hook windows keys
-rw-r--r--hw/xwin/ChangeLog8
-rw-r--r--hw/xwin/winkeybd.h6
-rwxr-xr-xhw/xwin/winkeyhook.c5
-rw-r--r--hw/xwin/winwndproc.c4
4 files changed, 15 insertions, 8 deletions
diff --git a/hw/xwin/ChangeLog b/hw/xwin/ChangeLog
index dd79b21e1..05319a130 100644
--- a/hw/xwin/ChangeLog
+++ b/hw/xwin/ChangeLog
@@ -1,3 +1,11 @@
+2005-01-10 Alexander Gottwald <ago at freedesktop dot org>
+
+ * winkeybd.h
+ * winkeyhook.c
+ * winwndproc.c:
+ Make keyhook feature work in multiwindowmode too
+ Hook windows keys
+
2005-01-06 Alexander Gottwald <ago at freedesktop dot org>
* winmultiwindowclass.c:
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
index f320c98e7..31c0cbc23 100644
--- a/hw/xwin/winkeybd.h
+++ b/hw/xwin/winkeybd.h
@@ -140,9 +140,9 @@ g_iKeyMap [] = {
/* 88 */ 0, 0, 0,
/* 89 */ 0, 0, 0,
/* 90 */ 0, 0, 0,
- /* 91 */ 0, 0, 0,
- /* 92 */ 0, 0, 0,
- /* 93 */ 0, 0, 0,
+ /* 91 */ VK_LWIN, KEY_LMeta, 0,
+ /* 92 */ VK_RWIN, KEY_RMeta, 0,
+ /* 93 */ VK_APPS, KEY_Menu, 0,
/* 94 */ 0, 0, 0,
/* 95 */ 0, 0, 0,
/* 96 */ 0, 0, 0,
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index 60176d9ad..edc51c99f 100755
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -65,6 +65,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
{
BOOL fPassKeystroke = FALSE;
PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) lParam;
+ HWND hwnd = GetActiveWindow();
/* Pass keystrokes on to our main message loop */
if (iCode == HC_ACTION)
@@ -79,9 +80,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
case WM_KEYUP: case WM_SYSKEYUP:
fPassKeystroke =
((p->vkCode == VK_TAB) && ((p->flags & LLKHF_ALTDOWN) != 0))
-#if 0
|| (p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN)
-#endif
;
break;
}
@@ -107,7 +106,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam)
lParamKey = lParamKey | (0x80000000 & ((p->flags & LLKHF_UP) << 24));
/* Send message to our main window that has the keyboard focus */
- PostMessage (g_hwndKeyboardFocus,
+ PostMessage (hwnd,
(UINT) wParam,
(WPARAM) p->vkCode,
lParamKey);
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 6188425dd..d41d00421 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -1012,7 +1012,7 @@ winWindowProc (HWND hwnd, UINT message,
* be returned to Windows. We may be able to trap the Windows keys,
* but we should determine if that is desirable before doing so.
*/
- if (wParam == VK_LWIN || wParam == VK_RWIN)
+ if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL)
break;
#ifdef XKB
@@ -1053,7 +1053,7 @@ winWindowProc (HWND hwnd, UINT message,
* be returned to Windows. We may be able to trap the Windows keys,
* but we should determine if that is desirable before doing so.
*/
- if (wParam == VK_LWIN || wParam == VK_RWIN)
+ if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL)
break;
/* Ignore the fake Ctrl_L that follows an AltGr release */