diff options
author | wm4 <wm4@nowhere> | 2014-11-08 12:14:29 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-08 12:14:29 +0100 |
commit | 249e8f6a54e154ac20c2f9ff0255b7b8bedae84e (patch) | |
tree | 181982a1eecc34730fa9e4bd759a974e4e61fb79 /video/out | |
parent | d859549424174179768fcd0310c75823a5ff7cb1 (diff) | |
download | mpv-249e8f6a54e154ac20c2f9ff0255b7b8bedae84e.tar.bz2 mpv-249e8f6a54e154ac20c2f9ff0255b7b8bedae84e.tar.xz |
Revert "w32_common: don't override alt+space"
This reverts commit d859549424174179768fcd0310c75823a5ff7cb1.
Going to apply the alternative fix through PR #1256, which came just
some seconds after pushing the reverted commit. The reverted commit
was reported as not actually working.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/w32_common.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c index f6a220b9bf..600aa26716 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -459,32 +459,23 @@ static int decode_key(struct vo_w32_state *w32, UINT vkey, UINT scancode) return c; } -static bool is_wm_key(UINT vkey) +static void handle_key_down(struct vo_w32_state *w32, UINT vkey, UINT scancode) { - return vkey == VK_F10 || (vkey == ' ' && key_state(VK_LMENU)); -} - -static bool handle_key_down(struct vo_w32_state *w32, UINT vkey, UINT scancode) -{ - if (is_wm_key(vkey)) - return 0; - // Ignore key repeat if (scancode & KF_REPEAT) - return 1; + return; int mpkey = mp_w32_vkey_to_mpkey(vkey, scancode & KF_EXTENDED); if (!mpkey) { mpkey = decode_key(w32, vkey, scancode & (0xff | KF_EXTENDED)); if (!mpkey) - return 1; + return; } mp_input_put_key(w32->input_ctx, mpkey | mod_state(w32) | MP_KEY_STATE_DOWN); - return 1; } -static bool handle_key_up(struct vo_w32_state *w32, UINT vkey, UINT scancode) +static void handle_key_up(struct vo_w32_state *w32, UINT vkey, UINT scancode) { switch (vkey) { case VK_MENU: @@ -496,7 +487,6 @@ static bool handle_key_up(struct vo_w32_state *w32, UINT vkey, UINT scancode) // get "stuck." This matches the behaviour of other VOs. mp_input_put_key(w32->input_ctx, MP_INPUT_RELEASE_ALL); } - return !is_wm_key(vkey); } static bool handle_char(struct vo_w32_state *w32, wchar_t wc) @@ -606,12 +596,14 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, break; case WM_SYSKEYDOWN: case WM_KEYDOWN: - if (!handle_key_down(w32, wParam, HIWORD(lParam))) + handle_key_down(w32, wParam, HIWORD(lParam)); + if (wParam == VK_F10) return 0; break; case WM_SYSKEYUP: case WM_KEYUP: - if (!handle_key_up(w32, wParam, HIWORD(lParam))) + handle_key_up(w32, wParam, HIWORD(lParam)); + if (wParam == VK_F10) return 0; break; case WM_CHAR: |