Linux up arrow simulation

Is it possible to simulate the up arrow by clicking on the echo?

To hopefully make this clearer, let me explain the assumption. I control omxplayer on my Raspberry Pi using a PHP server on Pi. To enter commands into the player, I have a FIFO login, which I can send using the PHP web page.

To stop the video, the player needs to press the q key, which I executed on my PHP page as follows: shell_exec ("echo -nq> $ pipe");

However, to skip ahead 10 minutes, this requires an up arrow. So, does anyone know how I can repeat the up arrow (into the pipe)?

I hope this is clear. I tried sending the escape sequence "echo -n \ c [[A> $ pipe", but this did not work :(

Thank you very much in advance Dan

+4
source share
1 answer

I found a thread regarding this. The following code should work:

shell_exec("echo -n $'\e'[A > $pipe"); 
+1
source

Source: https://habr.com/ru/post/1485197/


All Articles