[Gambas-user] send 'pgup' to process

Tobias Boege taboege at ...626...
Tue Jan 21 12:58:00 CET 2014


On Mon, 20 Jan 2014, Johny Provoost wrote:
> Hi,
> 
> I adapted the example Movieplayer from Beno?t .
> It's about sending keys to mplayer.
> I can send "+" and "-' to the process with success, but when want to 
> send "PageUp", "PageDown", "Up", "Down","Left", and 'right', I get stuck.
> 
> 
> the line is
> 
>    If Not $hProcess Then Return
>    Print #$hProcess,-here comes the key to send- ;
> 
> I tried
> key.PageUp,
> Desktop.Sendkeys("[PageUp"]), with and without the quotes.
> PgUp instead of PageUp
> 

You are talking to mplayer via its text-interactive interface when you are
using Print #$hProcess. You don't need to figure out how to send some key
codes because mplayer understands *commands* via this channel.

It's a shame that we haven't found time to finally prepare our mplayer-based
web radio program for public (or did we and just don't find it?).

However, you can start mplayer with its -slave switch and then look at the
command reference[0]. To, e.g., set the volume to 90%, do:

  Print $hProcess, "set_property volume 90"

To emulate PageUp, which is, by default, to seek forward by 10 minutes, you
may do

  Print $hProcess, "seek +600"

but it's really all in the docs.

Regards,
Tobi

[0] http://www.mplayerhq.hu/DOCS/tech/slave.txt

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list