[MPlayer-users] mplayer -slave... (how to) disable, keyboard input?

RVM rvm3000 at ya.com
Sat Dec 1 02:59:25 CET 2007


El Viernes, 30 de Noviembre de 2007 18:44, Lee Jackson escribió:

> I had a little time to look at this in some more detail this morning.
>
> mplayer.c line 2604
> mp_input_add_key_fd(-1,0,mplayer_get_key,NULL);
>
> The above line seems to be responsible for adding console keyboard input
> and if it is commented out, or the line immediately prior is prefixed by
> a suitable if statement [ e.g. if (!slave_mode) ], then slave mode works
> as I had expected it to behave. Thats a very quick hack though, based on
> VERY limited knowledge (note that Im also observing this problem with
> the svn version obviously).
>
> Anways, the console keyboard input behavior in slave mode APPEARS to be
> broken (and from browsing the rep, has been for a long time) and it
> would be useful for an active developer to have a look at this - it may
> just be a case of the documentation differing from the
> implimentation.... as an aside, the importance of this to me is that I'm
> embedding mplayer in a QT4 widget and I want to disable any other input
> apart from that which I define.
>
> I note there are several GUIs for mplayer which presumably are not
> affected by this; can anyone provide a quick heads up on how they
> approach remapping/ignoring mplayers keyboard handling?

I had the same problem when I started to develop smplayer. I just copied the 
method that kplayer used. It passes to mplayer an input.conf (-input 
conf=..../input.conf), with something like this:

RIGHT gui_about
LEFT gui_about
DOWN gui_about
UP gui_about
PGUP gui_about
PGDWN gui_about
- gui_about
+ gui_about
ESC gui_about
(and so on, for all keys)

This still has problems if mplayer has been compiled with gui support. I think 
it's better to replace "gui_about" with something mplayer can't understand, 
that way it's completely ignored.

Anyway this solution is ugly. I'd prefer mplayer had a switch to disable all 
keyboard input (not only from the console).

BTW, this issue does NOT happen under Windows. For some reason, I don't know 
if it's a bug or intentional, when mplayer in Windows is embedded in another 
application it doesn't get keyboard input.

-- 
RVM



More information about the MPlayer-users mailing list