Qt4 libVLC 1.1.0 handle mouse events

This forum is about all development around libVLC.
uKCuH
New Cone
New Cone
Posts: 5
Joined: 12 Jul 2010 11:19
Location: Russian, Saint-Petersburg

Qt4 libVLC 1.1.0 handle mouse events

Postby uKCuH » 12 Jul 2010 11:23

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15128
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Qt4 libVLC 1.1.0 handle mouse events

Postby Rémi Denis-Courmont » 12 Jul 2010 17:36

Code: Select all

libvlc_video_set_mouse_input(mp, false);
before playback is started should work, at least on X11 systems.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

uKCuH
New Cone
New Cone
Posts: 5
Joined: 12 Jul 2010 11:19
Location: Russian, Saint-Petersburg

Re: Qt4 libVLC 1.1.0 handle mouse events

Postby uKCuH » 13 Jul 2010 12:50

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());

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Qt4 libVLC 1.1.0 handle mouse events

Postby erwan10 » 13 Jul 2010 17:55

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

uKCuH
New Cone
New Cone
Posts: 5
Joined: 12 Jul 2010 11:19
Location: Russian, Saint-Petersburg

Re: Qt4 libVLC 1.1.0 handle mouse events

Postby uKCuH » 14 Jul 2010 08:47

Thanks for the answer, I'll try it. And will it be fixed for Win32 platform in the next versions?

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Qt4 libVLC 1.1.0 handle mouse events

Postby erwan10 » 14 Jul 2010 10:22

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests