[vlc-commits] Win32: escape fullscreen with the escape key

Ludovic Fauvet git at videolan.org
Tue Jan 15 13:37:57 CET 2013


npapi-vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Tue Jan 15 13:34:40 2013 +0100| [1b13b853b327c996e697fc6722a435f5ad2c864c] | committer: Ludovic Fauvet

Win32: escape fullscreen with the escape key

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=1b13b853b327c996e697fc6722a435f5ad2c864c
---

 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:



More information about the vlc-commits mailing list