[MPlayer-users] Read key strokes from terminal, not standard input

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Dec 4 12:36:17 CET 2010


On Sat, Dec 04, 2010 at 12:08:59PM +0100, Andre Majorel wrote:
> On 2010-12-04 11:22 +0100, Reimar Döffinger wrote:
> > On Sat, Dec 04, 2010 at 10:52:31AM +0100, Andre Majorel wrote:
> > > Is there a way to make mplayer get key strokes from the
> > > controlling terminal (/dev/tty) instead of stdin ?
> > 
> > Make /dev/tty stdin?
> > As in
> > mplayer < /dev/tty
> 
> Yes, like this but without going through a shell.

Still the same, just replace stdin. For example in C:
dup2(0, open("/dev/tty", O_RDONLY));
(obviously missing error checks etc.)


More information about the MPlayer-users mailing list