]> git.sesse.net Git - vlc/commitdiff
msw(Win32): give libvlc users access to input events (mouse/keyboard)
authorErwan Tulou <erwan10@videolan.org>
Thu, 4 Aug 2011 11:38:25 +0000 (13:38 +0200)
committerErwan Tulou <erwan10@videolan.org>
Thu, 4 Aug 2011 20:09:05 +0000 (22:09 +0200)
if libvlc users disable both mouse and keyboard events, chances are they're
trying to regain control over them. The WS_DISABLED flag exactly fits this need.

The only thing is that it is an overall flag that doesn't differentiate mouse and keyboard.

modules/video_output/msw/events.c

index 85f715ecd44d2459c96a5cf5535042d0ed24b2b3..c62d7c7a8990b355e5121e989b37b1d6c9f53902 100644 (file)
@@ -597,6 +597,12 @@ static int DirectXCreateWindow( event_thread_t *p_event )
     {
         i_style = WS_VISIBLE|WS_CLIPCHILDREN|WS_CHILD;
         i_stylex = 0;
+
+        /* allow user to regain control over input events if requested */
+        bool b_mouse_support = var_InheritBool( vd, "mouse-events" );
+        bool b_key_support = var_InheritBool( vd, "keyboard-events" );
+        if( !b_mouse_support && !b_key_support )
+            i_style |= WS_DISABLED;
     }
 
     p_event->i_window_style = i_style;