summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnon Gilboa <agilboa@redhat.com>2009-11-17 16:48:23 +0200
committerYaniv Kamay <ykamay@redhat.com>2010-01-03 17:37:33 +0200
commit03f23b870ea00c94f9f6148f6b1017742aca225d (patch)
treedecf76810f1149fd50fbfa401c3671fed50844a4
parent702b92cdb80eac8fd3b5da3a96bfcfa622f7c7af (diff)
downloadspice-03f23b870ea00c94f9f6148f6b1017742aca225d.tar.gz
spice-03f23b870ea00c94f9f6148f6b1017742aca225d.tar.xz
spice-03f23b870ea00c94f9f6148f6b1017742aca225d.zip
spice: pass modifiers stroke events down the hook chain
-rw-r--r--client/windows/red_window.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp
index ab1aa159..9365c69d 100644
--- a/client/windows/red_window.cpp
+++ b/client/windows/red_window.cpp
@@ -666,10 +666,6 @@ static LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lP
dwMsg += hooked->scanCode << 16;
dwMsg += hooked->flags << 24;
- // Forward these keys so the keyboard leds will light up.
- BOOL bNextHook = ((hooked->vkCode == VK_CAPITAL) ||
- (hooked->vkCode == VK_SCROLL) || (hooked->vkCode == VK_NUMLOCK));
-
// In some cases scan code of VK_RSHIFT is fake shift (probably a bug) so we
// convert it to non extended code. Also, QEmu doesn't expect num-lock to be
// an extended key.
@@ -679,7 +675,19 @@ static LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lP
SendMessage(focus_window, wParam, hooked->vkCode, dwMsg);
- if (bNextHook == FALSE) {
+ // Forward all modifier key strokes to update keyboard leds & shift/ctrl/alt state
+ switch (hooked->vkCode) {
+ case VK_CAPITAL:
+ case VK_SCROLL:
+ case VK_NUMLOCK:
+ case VK_LSHIFT:
+ case VK_RSHIFT:
+ case VK_LCONTROL:
+ case VK_RCONTROL:
+ case VK_LMENU:
+ case VK_RMENU:
+ break;
+ default:
return 1;
}
}