Opened 11 years ago

Last modified 11 years ago

#1047 reopened defect

mplayer vs. extra ENTER keystrokes

Reported by: jidanni@… Owned by: reimar
Priority: if idle Component: core
Version: 1.0rc2 Severity: minor
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

The following is my long ordeal to make mplayer work in environments
where extra ENTER keystrokes might be sent to mplayer.

$ mplayer file, then hit p to pause. then hit Z to suspend, do some
shell commands, then return to mplayer with "fg". No do "p" again to
unpause... but Oh No, get "Exiting... (End of file)"! Maybe there are
some ENTERs that made it into mplayer.

Also in an emacs' shell window (using -quiet) we cannot do anything as
there are ENTERs sent at the end of each line.

OK, in our journey to workaround it, we note you badly need to mention
"See the CONFIGURATION FILES section." in the -input section of the
man page. Also there uppercase this: PATHS ARE RELATIVE TO
~/.mplayer/. and add "use $PWD/file.conf, as file.conf, ./file.conf
will not reference the current working directory!", else nobody ever
expected such an odd surprise.

By the way, why not catch errors,
Invalid command for bound key ENTER : ...
at file read in time, instead of waiting till they hit the key?

OK, what I thought might be as easy as
$ mplayer -bind ENTER=noop REC001.WAV
turns out to need this whole makefile:
i=input.conf
$i:/etc/mplayer/$i
# perl -nwe 'print unless /ENTER/' $? > $@
# perl -pwe 's/
(ENTER) .*/$$1 #OFF!/' $? > $@

perl -pwe 's/(ENTER) .*/$$1 pause/' $? > $@

m:$i

mplayer -input conf=$$PWD/$? REC001.WAV

In the above makefile, I end up binding ENTER to pause, as you offer
no NOOP, and that's the best I can do to turn it off.

Change History (7)

comment:1 Changed 11 years ago by compn

  • Resolution set to invalid
  • Status changed from new to closed

heh, just edit mplayer/etc/input.conf and comment out the enter key
or if that somehow does not work bind it to ENTER menu hide

comment:2 Changed 11 years ago by compn

you can also just grab input.conf from source and put it in ~/.mplayer/input.conf or /etc/mplayer/input.conf (depending on your confdir configure option)

and then just edit that file ...

comment:3 Changed 11 years ago by jidanni@…

$ cat ~/.mplayer/config
# Write your default config options here!
ENTER menu hide
$ mplayer -quiet file.mp3
mplayer: /usr/lib/libtheora.so.0: no version information available (required by mplayer)
MPlayer dev-SVN-r25315
CPU: Intel(R) Celeron(R) M processor 1.40GHz (Family: 6, Model: 13, Stepping: 6)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Option ENTER needs a parameter at line 2

comment:4 Changed 11 years ago by jidanni@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

OK, now using it in ~/.mplayer/input.conf: observations:
now p ENTER won't pause anymore in an emacs shell window.

Anyway, please test the solutions you mention before closing this bug.

Bug: Mplayer lacks a no-op binding, so one must use
ENTER menu hide
if one wants to override /etc/mplayer/input.conf

comment:5 Changed 11 years ago by compn

now p ENTER won't pause anymore in an emacs shell window.

what do you mean by p ENTER ?
its always been p pause
and pause still works after you rebind the enter key.

btw try ENTER ignore
instead of ENTER menu hide

seems to work here, i'll add it to the docs...

comment:6 Changed 11 years ago by compn

By the way, why not catch errors,
Invalid command for bound key ENTER : ...
at file read in time, instead of waiting till they hit the key?

because commands can be sent from another program using slave mode.
so there is no reason to scan a file. also some commands like RUN or osd_show_text can do anything so its not possible to check it for errors.

comment:7 Changed 11 years ago by jidanni@…

OK, ENTER ignore works great. In documenting it, perhaps also mention
a user found it worked great with an emacs shell window.

But wait, maybe mplayer should be aware that stty(1) shows that xterm
vs. a emacs shell window are different, and adjust itself accordingly
without making the user do anything special.

Maybe it is all mplayer's fault, binding the important ENTER key, thus
precluding certain environments. But maybe it's too late now to change.

Anyways, one would want a way to bind ENTER to ignore from the command
line, instead of messing with a file every time one switches from
xterm to an emacs shell window: something like
$ mplayer --bind-key ENTER\ ignore bla.mp3

Note: See TracTickets for help on using tickets.