w32_common: open window menu on Alt+Space

Since mpv doesn't call TranslateMessage, this must be done manually.

Should fix #1254
This commit is contained in:
James Ross-Gowan 2014-11-08 21:43:14 +11:00 committed by wm4
parent 249e8f6a54
commit 68ecbdf920
1 changed files with 10 additions and 0 deletions

View File

@ -595,6 +595,16 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
}
break;
case WM_SYSKEYDOWN:
// Open the window menu on Alt+Space. Normally DefWindowProc opens the
// window menu in response to WM_SYSCHAR, but since mpv translates its
// own keyboard input, WM_SYSCHAR isn't generated, so the window menu
// must be opened manually.
if (wParam == VK_SPACE) {
SendMessage(w32->window, WM_SYSCOMMAND, SC_KEYMENU, ' ');
return 0;
}
// Handle all other WM_SYSKEYDOWN messages as WM_KEYDOWN
case WM_KEYDOWN:
handle_key_down(w32, wParam, HIWORD(lParam));
if (wParam == VK_F10)