libVLC1.10 for Windows: Event handling
Posted: 22 Jun 2010 19:27
If you use functions libvlc_video_set_key_input and libvlc_video_set_mouse_input to let your own application handle the keyboard and mouse events, you'll find that no more event is handled by libVLC but also there is no event sent to your application. You can make it work with low effort. Event handling is done in modules/video_output/msw/events.c
Find following code around line 288 (function Eventthread):
Replace it with:
Find code around line 291:
and replace it with:
These changes make sure that the event isn't ignored but forwarded to the parent window. After compiling the sources your changes will be in libdirect3d_plugin.dll.
Best regards,
Jörg
Find following code around line 288 (function Eventthread):
Code: Select all
if( !b_mouse_support && isMouseEvent( msg.message ) )
continue;
Code: Select all
if( !b_mouse_support && isMouseEvent( msg.message ) )
{
/*
* if there is a parent window, post message to it!
*/
if( p_event->parent_window != NULL )
{
/*
* Messages we don't handle directly are dispatched
* to the parent window using the window procedure
*/
PostMessage(p_event->hparent, msg.message,
msg.wParam, msg.lParam);
}
continue;
}
Code: Select all
if( !b_key_support && isKeyEvent( msg.message ) )
continue;
Code: Select all
if( !b_key_support && isKeyEvent( msg.message ) )
{
/*
* if there is a parent window, post message to it!
*/
if( p_event->parent_window != NULL )
{
/*
* Messages we don't handle directly are dispatched
* to the parent window using the window procedure
*/
PostMessage(p_event->hparent, msg.message,
msg.wParam, msg.lParam);
}
continue;
}
Best regards,
Jörg