in reply to Sending Signals / Keyboard Interrupts

Sounds to me like you still want user input, but want a way to do it in a non-blocking way.

Have you considered starting a second thread in your program? The second thread could do regular blocking reads from stdin and then use shared variables to control the flow of the main thread. It would be using sequences of keys (ending in CR) rather than key combinations, but from your description, it sounds like that would be fine.

(See threads and threads::shared)

  • Comment on Re: Sending Signals / Keyboard Interrupts