From 1b13b853b327c996e697fc6722a435f5ad2c864c Mon Sep 17 00:00:00 2001 From: Ludovic Fauvet Date: Tue, 15 Jan 2013 13:34:40 +0100 Subject: [PATCH] Win32: escape fullscreen with the escape key --- common/win32_fullscreen.cpp | 15 +++++++++++++++ common/win32_fullscreen.h | 1 + 2 files changed, 16 insertions(+) diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp index 45aab28..4958f98 100644 --- a/common/win32_fullscreen.cpp +++ b/common/win32_fullscreen.cpp @@ -898,6 +898,11 @@ LRESULT CALLBACK VLCFullScreenWnd::FSWndWindowProc(HWND hWnd, UINT uMsg, WPARAM } break; } + case WM_KEYDOWN: { + if (fs_data) + fs_data->_WindowsManager->OnKeyDownEvent(wParam); + break; + } default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } @@ -1064,6 +1069,16 @@ bool VLCWindowsManager::IsFullScreen() return 0!=_FSWnd && 0!=_HolderWnd && GetParent(_HolderWnd->hWnd())==_FSWnd->getHWND(); } +void VLCWindowsManager::OnKeyDownEvent(UINT uKeyMsg) +{ + switch(uKeyMsg){ + case VK_ESCAPE: + case 'F': + EndFullScreen(); + break; + } +} + void VLCWindowsManager::OnMouseEvent(UINT uMouseMsg) { switch(uMouseMsg){ diff --git a/common/win32_fullscreen.h b/common/win32_fullscreen.h index 8ac5b6d..34096de 100644 --- a/common/win32_fullscreen.h +++ b/common/win32_fullscreen.h @@ -285,6 +285,7 @@ public: bool getNewMessageFlag() const {return _b_new_messages_flag;}; public: + void OnKeyDownEvent(UINT uKeyMsg); void OnMouseEvent(UINT uMouseMsg); private: -- GitLab