(libvlc) Need ability to disable input / hotkeys
Posted: 14 Apr 2008 05:44
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.
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.