Page 1 of 1

Disable mouse and hotkeys

Posted: 28 May 2008 19:55
by davidhoyt
I've seen similar posts while searching through this forum and never found an answer -- is there a way to disable all mouse and keyboard input through JVLC/VLC for all modules? The reason being that I want those events to bubble up to Java and not be consumed in VLC so I can do such things as display a context menu over the video and disable fullscreen mode when a video is double-clicked. Thanks!

Re: Disable mouse and hotkeys

Posted: 30 May 2008 19:40
by davidhoyt
I would really appreciate any leads anyone could give me - even if it involves modifying the source and recompiling.

Re: Disable mouse and hotkeys

Posted: 30 May 2008 19:44
by Jean-Baptiste Kempf
Don't compile hotkeys. But I am not sure the event would go to Java...

Re: Disable mouse and hotkeys

Posted: 31 May 2008 00:27
by davidhoyt
Can I just remove the hotkeys plugin and expect it to work or will I have to reconfigure and recompile the entire thing?

Re: Disable mouse and hotkeys

Posted: 31 May 2008 01:29
by Jean-Baptiste Kempf
yes, you can. No idea, if it'll make what you want though.

Re: Disable mouse and hotkeys

Posted: 02 Jun 2008 10:48
by cbouleau
Hello,

I had a similar problem than yours and finally (after a lot of search but neither answer nor help in any forum) I managed to disable some mouse events (all the button events), after making a little patch in a VLC source.
The solution I found is (unfortunately) not generic but can be easily adapted to other cases.
I worked on VLC 0.8.6c, on Windows XP plateform, and I modified the DirectX video output events handler.
I did not manage to act at a higher level (in libvlc), but had not enough time to implement a better solution (I presume that if a better solution was possible, someone would have already posted it :wink: ).

Anyway the top level application into which my libvlc player is embedded now receives all the windows mouse events it needs, and the goal is reached :D .

If you are interested, I can give my (simple) patch.

Chris. B

P.S. :
- The windows key events are also processed in this source file, so they could be taken into account too.
- I think you can make same kind of patch if you use another video output module than directX

Re: Disable mouse and hotkeys

Posted: 02 Jun 2008 17:56
by Jean-Baptiste Kempf
We are interested in the patches...

Re: Disable mouse and hotkeys

Posted: 02 Jun 2008 19:21
by davidhoyt
I would love to see your patch. Maybe one of the VLC developers also knows of a higher level place we could patch to take out mouse/keyboard event handling so it applies to all output modules?

Re: Disable mouse and hotkeys

Posted: 03 Jun 2008 14:49
by cbouleau
Hello,

Thus here is the patch.

- Goal : let the parent window process the video window button events,
and disable the VLC default behaviour (fullscreen on double click an so on ...).
- Based on VLC 0.8.6c version.
- Tested on Windows XP SP2.
- Involves DirectX video output module.

1 modified source file: "vlc-0.8.6c\modules\video_output\directx\events.c" :

Replace all the "case WM_*BUTTON*" code (i.e. from line 198 to line 144) by this code:

Code: Select all

case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: case WM_MBUTTONDOWN: case WM_MBUTTONUP: case WM_RBUTTONDOWN: case WM_RBUTTONUP: msg_Dbg( p_event, "msg.hwnd=%d, get WM BUTTON message %u", (int)(msg.hwnd), msg.message ); msg_Dbg( p_event, "hvideownd=%d, hparent=%d", (int)(p_event->p_vout->p_sys->hvideownd), (int)(p_event->p_vout->p_sys->hparent) ); if ( p_event->p_vout->p_sys->hparent ) { // re-post the event message to the parent BOOL result = PostMessage(p_event->p_vout->p_sys->hparent, msg.message, msg.wParam, msg.lParam); msg_Dbg( p_event, "PostMessage returned %d", (int)result); } else { msg_Dbg( p_event, "hparent window is null, no re-PostMessage"); } break;
That's all (but was no so easy to find :cry: ).

I presume you can do similar modifications (in the same source file) to process key events or mouse move events.

I hope it will help you (and other people),

Good luck
Chris B.

Re: Disable mouse and hotkeys

Posted: 05 Jun 2008 17:40
by davidhoyt
Thanks so much! Does anyone have a generic solution (one that would apply to all output modules)? As in - is there a place where I could turn it off globally? I just want VLC to handle the audio and video and nothing more.

At least this will get me started on the Windows side of things.

Re: Disable mouse and hotkeys

Posted: 13 Jun 2008 20:15
by davidhoyt
Hello? Anyone? <Crickets chirping>

Re: Disable mouse and hotkeys

Posted: 01 Jul 2008 23:24
by davidhoyt
I still don't think anyone has ever had a satisfactory response on this topic. I'm not the only one w/ this question. MPlayer has an option to disable all mouse/keyboard inputs. I haven't seen anything in VLC that will allow me to do that. Is it so hard to have VLC ignore all mouse/keyboard events if I ask it to?

At the very least, can someone point me in the right direction of which file or area to look at to make this change myself (to globally disable keyboard/mouse, not just for a particular module)? I have zero experience working w/ the VLC source and so I need some help.

I would have figured this option already existed. If it does and I just overlooked it, please let me know! Thanks! :)

Re: Disable mouse and hotkeys

Posted: 02 Jul 2008 09:19
by Jean-Baptiste Kempf
Nothing is said because they are two different things:
- Disable mouse and hotkeys, which is doable
- Forward the event to mother application, which is more complex and not implemented.

Re: Disable mouse and hotkeys

Posted: 02 Jul 2008 20:59
by davidhoyt
Thanks for your reply! :D How do I disable mouse/keyboard input?

Re: Disable mouse and hotkeys

Posted: 16 Jul 2008 22:41
by davidhoyt
Anyone? I just want to ignore all mouse and keyboard input. I would really, really, really appreciate it. This is the one thing that keeps us from moving over to VLC over MPlayer. :(