summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-04-13 17:25:30 +0200
committerwm4 <wm4@mplayer2.org>2012-04-13 17:27:18 +0200
commit4dc0e54d4fffa2b81fbf6fb9b875303638eb1c9a (patch)
tree71727e645089d9441c460851a15099ee6400ccf3 /libvo
parent1d527f0cf25ff51021a6042079cc51b64569585a (diff)
downloadmpv-4dc0e54d4fffa2b81fbf6fb9b875303638eb1c9a.tar.bz2
mpv-4dc0e54d4fffa2b81fbf6fb9b875303638eb1c9a.tar.xz
win32: prevent modifier keys from getting stuck
Especially Alt would get stuck when using Alt+Tab to change focus. Apparently Windows doesn't send an appropriate key up message. Solve this by resetting the modifier state on focus change.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/w32_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index ff9e2dd505..513cf2820c 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -239,6 +239,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
}
break;
}
+ case WM_SETFOCUS:
+ case WM_KILLFOCUS:
+ // prevent modifier keys from getting stuck
+ memset(key_state, 0, sizeof(key_state));
+ break;
case WM_LBUTTONDOWN:
if (!vo_nomouse_input && (vo_fs || (wParam & MK_CONTROL))) {
mplayer_put_key(MOUSE_BTN0 | mod_state());