Recent

Author Topic: [Solved]Simulate keypress TProcess.  (Read 7680 times)

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: Simulate keypress TProcess.
« Reply #15 on: September 30, 2019, 10:01:42 pm »
[...] however I have not found any examples how I can use Tprocess as a kind of wrapper (meaning have the pipe open and controlling the executable) for an application.

There are examples (and pointers to others) in the wiki page about Executing External Programs.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Simulate keypress TProcess.
« Reply #16 on: September 30, 2019, 11:01:13 pm »
Ok, after doing quite some investigation I have found a solution here:

https://serverfault.com/questions/178457/can-i-send-some-text-to-the-stdin-of-an-active-process-running-in-a-screen-sessi

It can be boiled down to this:

First I start the program like this:

(while [ 1 ]; do sleep 1; done) | omxplayer Engl.mov

Then I can control it via the process id like this:

echo -n p > /proc/$(pgrep omxplayer)/fd/0

The outstanding part now to find a way to discover when omxplayer is at last frame (as the omxplayer never is released due to the endless loop), so a rewind can be sent to all players, and combine it into to a program controlled over the network, which can be done by a multicast.

 

TinyPortal © 2005-2018