On Apr 21, 12:23 pm, "Michal Suchanek" <hramr... / centrum.cz> wrote:
> On 19/04/07, bjor... / gmail.com <bjor... / gmail.com> wrote:
>
> > Hi
>
> > I'm trying to create a simple ruby script, which forks mplayer and
> > afterwards it stays in a while loop which blocks on gets (this is to
> > get keyboard input). I start this script from a terminal (linux). When
> > i start it, it forks mplayer and the focus is on mplayer now. If i
> > press some keys on my keyboard these are send to mplayer.
>
> > Is there a solution to get focus on the terminal/script again (without
> > user interaction) after i started mplayer? Or another solution to get
> > keyboard commands into my script?
>
> In X the newly started program usually gets keyboard focus unless you
> configure your windowmanager do do something special. Of course, the
> steps vary wildly between different windowmanagers, and may would
> probably not allow such thing at all.
>
> However, if you started the script from another machine through ssh or
> on another X server (you should be able to put in another videocard,
> and start a second X server) you should get  the input to your script.

Is there a way to get all keyboard input with my ruby script.