Page 1 of 1

libvlc - how to catch events

Posted: 13 Dec 2007 15:24
by JeffM-35
I'm building a small application in C++ that uses libvlc to play a 10 second 'intro' video. I've used the http://wiki.videolan.org/LibVLC_Tutorial_086c libvlc C++ code successfully, and can position the video, set the window size, even make it without a border, etc. by passing appropriate arguments.

My question is this - how can I, or where do I go about intercepting user input. In other words, I have a 800x600 video window set up on a 1024x768 screen, no box or border on the video, no user controls, etc. When the user of my little application double clicks on the video window, it becomes full screen. How do I stop that? Ideally, what I want to do is if someone using the c++ application clicks on the video window, I want to exit the video window to close and my application notified that the video has been closed.

I've just started playing with libvlc, and have looked through the forums for a few hours and can't seem to find any relevant posts regarding this.

Any advice much appreciated.

Re: libvlc - how to catch events

Posted: 13 Dec 2007 15:42
by jboileau
Are you using your own window? If not this might be why. Create a Window and tell lbvlc to use it with a call to libvlc_video_set_parent. ex:

libvlc_video_set_parent(LibvlcInstance, (libvlc_drawable_t)HWindow, LibvlcException);

You can then do what you want with the window.

Re: libvlc - how to catch events

Posted: 14 Dec 2007 03:31
by JeffM-35
Thanks for the reply jboileau. Yes, I am creating my own window and successfully passing the handle to the libvlc_video_set_parent. In fact, I can intercept keyboard events no problem, even mouse movement events, but for whatever reason not the double mouse click - the event causes the window to toggle fullscreen. I'm stuck.