Page 1 of 1

(libvlc) Need ability to disable input / hotkeys

Posted: 14 Apr 2008 05:44
by Vek
Currently if you load up the player via libvlc or the new media player interfaces (public interfaces) and embed them in an application, vlc will automatically swallow and process all mouse and keyboard input that hits its window, and not forward it to the outlying application.

This makes it very hard to embed video windows inside things like opengl windows and so on, as the moment the user double clicks on the video window (for example) it goes full screen. And there's no way to stop that.

Looking at the source code, it seems that each particular video out (SDL, DirectX, GL) has input handling built into the vout module, with no clear way to seperate, so this task might be a bit more difficult than it seems.

However, for embedding, its kind of a necessary thing for the parent app to be able to handle things like that. A custom opengl-accelerated media player (as in, smooth transformations and so on) is not the only thing that gets hindered by this. For example, if someone were to try to use it to play video inside a game, (perhaps during a cutscene, or even just in the corner, say, as a tutorial or something)... or inside a box as part of another application, the user could double click on that box and whoops... the app would no longer get any further events and there would be no way to prevent it from going full screen...

As it stands now, its pretty clean and easy to embed VLC thing in a QT4 window, and it works pretty well, but it 'steals' all input, denying it to the underlying application, whenever the mouse is over it. This appears to be how it is supposed to work, by design of the architecture, but I'm thinking a simple --no-hotkeys or a --no-module <modulename> or just --no-mouse-input or something... optional stuff. It would improve its ability to be embedded.

Also of note is that this behavior is inconsistent across platforms. For example, in ubuntu/Qt4, it always swallows all keyboard and mouse events, and always denies them to the underlying window, regardless of fullscreen status. Wheras in win32/Qt4, it absorbs all double click events (toggling fullscreen), but only consumes keyboard events while in full screen.

Unless I'm missing something and there's already a way to do this? I doubt it though, I've been digging into the code - the code to handle mouse double clicks in win32, for example, is directly in the video out module, and directly installs a window message function which intercepts the win32 double click event, and immediately requests full screen toggle.

I guess if theres an actual desire for this type of option, I could look into doing it, but so far it looks like the only way to do it would be to add those options in and then alter every video out module to check those options before actually capturing events, etc.

Re: (libvlc) Need ability to disable input / hotkeys

Posted: 14 Apr 2008 06:14
by Jean-Baptiste Kempf
mail vlc-devel@

Re: (libvlc) Need ability to disable input / hotkeys

Posted: 04 Mar 2010 11:58
by gautham
Hi there
Is there a possibility to handle mouse events in VLC plugin? I mean, I would like to do things like Pan, Tilt or Zoom using the VLC plugin APIs. Let me know.

Re: (libvlc) Need ability to disable input / hotkeys

Posted: 04 Mar 2010 16:21
by VLC_help
Is there a possibility to handle mouse events in VLC plugin?
It is. Puzzle interactive filter uses mouse in case you want sample code
http://git.videolan.org/?p=vlc.git;a=bl ... r/puzzle.c;