[vlc-commits] commit: msw: add support for --[no]-mouse-events and --[no] -keyboard-events (Erwan Tulou )
git at videolan.org
git at videolan.org
Mon Mar 8 19:47:41 CET 2010
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sun Feb 28 17:25:47 2010 +0100| [a63296bc50dcf9f421863d509709f5e4b7b2902f] | committer: Erwan Tulou
msw: add support for --[no]-mouse-events and --[no]-keyboard-events
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a63296bc50dcf9f421863d509709f5e4b7b2902f
---
modules/video_output/msw/events.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index a65fc64..1945b12 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -129,6 +129,18 @@ static long FAR PASCAL DirectXEventProc( HWND, UINT, WPARAM, LPARAM );
static int DirectXConvertKey( int i_key );
+static inline bool isMouseEvent( WPARAM type )
+{
+ return type >= WM_MOUSEFIRST &&
+ type <= WM_MOUSELAST;
+}
+
+static inline bool isKeyEvent( WPARAM type )
+{
+ return type >= WM_KEYFIRST &&
+ type <= WM_KEYLAST;
+}
+
/*****************************************************************************
* EventThread: Create video window & handle its messages
*****************************************************************************
@@ -146,6 +158,9 @@ static void *EventThread( void *p_this )
HMODULE hkernel32;
int canc = vlc_savecancel ();
+ bool b_mouse_support = var_InheritBool( p_event->vd, "mouse-events" );
+ bool b_key_support = var_InheritBool( p_event->vd, "keyboard-events" );
+
vlc_mutex_lock( &p_event->lock );
/* Create a window for the video */
/* Creating a window under Windows also initializes the thread's event
@@ -204,6 +219,12 @@ static void *EventThread( void *p_this )
if( b_done )
break;
+ if( !b_mouse_support && isMouseEvent( msg.message ) )
+ continue;
+
+ if( !b_key_support && isKeyEvent( msg.message ) )
+ continue;
+
/* */
switch( msg.message )
{
More information about the vlc-commits
mailing list