2

I'm testing out pipes and have hit a little road block.

I want to be able to simulate pressing the right arrow key through a file pointer opened by popen. The file pointer opens a display program on a different terminal, much like a projector. I would like to send a signal to advance the next image (the right arrow key).

How do I go about sending this signal? I realize this will be specific to my computer (BOIS/keyboard setup), but I'm not looking for this to be portable in anyway.

It seems from my trials, everything I send via fprintf is interpreted as readable characters rather than special codes.

The slideshow program cannot be changed, so that isn't an option. Any direction would be greatly appreciated.

Deanie
  • 2,316
  • 2
  • 19
  • 35

1 Answers1

1

Two possibilities come to mind:

From the comments, that appears to be what was requested. Arrow (cursor) key escape sequences are well-standardized, as shown in

If that works for you, one of the pitfalls is that you probably have to do frequent fflush's to make it work.

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • I spoke too soon, this solution didn't work in the final environment, just in my initial test environment. – Deanie May 19 '15 at 04:49