Page 1 of 1

Qt4 libVLC 1.1.0 handle mouse events

Posted: 12 Jul 2010 11:23
by uKCuH
Whether it is possible to handle mouse events in QWidget (Qt4) with usage libVLC 1.1.0 (in particulary click of right mouse button for show popup menu)? Now libVLC swallows all mouse events.

Re: Qt4 libVLC 1.1.0 handle mouse events

Posted: 12 Jul 2010 17:36
by RĂ©mi Denis-Courmont

Code: Select all

libvlc_video_set_mouse_input(mp, false);
before playback is started should work, at least on X11 systems.

Re: Qt4 libVLC 1.1.0 handle mouse events

Posted: 13 Jul 2010 12:50
by uKCuH

Code: Select all

libvlc_video_set_mouse_input(mp, false);
before playback is started should work, at least on X11 systems.
Has not helped.

The cursor only hides at

Code: Select all

libvlc_video_set_mouse_input(mp, false);
Interruptions in one of these functions do not occur:

Code: Select all

bool VideoWidget::winEvent(MSG * message, long * result) { if (message->message == WM_LBUTTONDOWN ) { } return QWidget::winEvent(message, result); } void VideoWidget::mouseDoubleClickEvent(QMouseEvent *event) { ; }


As a descriptor I have transferred to libVLC a descriptor of VideWidget:

Code: Select all

libvlc_media_player_set_hwnd (_mp, (void*) this->winId());

Re: Qt4 libVLC 1.1.0 handle mouse events

Posted: 13 Jul 2010 17:55
by erwan10
Unlike Linux, disabling mouse events on Win32 at vlc level (libvlc_video_set_mouse_input(mp, false)) _only_ disables mouse interaction. There is no built-in propagation flag that allows the system to get up the hierarchy of windows till one is interested in processing such events.

As of today, for retrieving mouse events on Win32, the only way is to use system-wide hooks (as described on http://msdn.microsoft.com/en-us/library ... 85%29.aspx). This works very fine, though it is a bit complicated.

Erwan10

Re: Qt4 libVLC 1.1.0 handle mouse events

Posted: 14 Jul 2010 08:47
by uKCuH
Thanks for the answer, I'll try it. And will it be fixed for Win32 platform in the next versions?

Re: Qt4 libVLC 1.1.0 handle mouse events

Posted: 14 Jul 2010 10:22
by erwan10
Thanks for the answer, I'll try it. And will it be fixed for Win32 platform in the next versions?
Well, there is no real bug. And what you wish to do is 100% available.

It is just that, had vlc been designed to reuse the main GUI thread for video subwindows, the libvlc developpers would have been able to access those mouse events through their event loop. That would have been a lot simpler.

Will this design change ? I don't know (it's not a trivial thing to do)

Erwan10