[vlc-commits] msw(Win32): give libvlc users access to input events (mouse/keyboard)

Erwan Tulou git at videolan.org
Thu Aug 4 22:30:28 CEST 2011


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Aug  4 13:38:25 2011 +0200| [a8478f733ce80f9d3081bc886d653c410be56a24] | committer: Erwan Tulou

msw(Win32): give libvlc users access to input events (mouse/keyboard)

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.

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

 modules/video_output/msw/events.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index 85f715e..c62d7c7 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -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;



More information about the vlc-commits mailing list