[comp.unix.programmer] Interruptable curses 'getch'.

tom@hprmokg.HP.COM (Thomas Vachuska) (10/09/90)

Hello...

    I was wondering if anyone knows how to coerce 'curses' routine 'getch' to
return with an abnormal status (say -1) after the process receives an interrupt.
This is similar to the semantics of a 'read' call on a slow (tty) device.

    The function 'getch' returns -1 if the 'nodelay' is active (for the
particular window), and I'm aware that there is a workaround solution for my
problem by using the 'nodelay' feature, but I'm not willing to pay the CPU
penalty assiciated with polling for input.  Next alternative that I considered
is to write 'getich' (or interruptable version of getch) but I figured that
before I do so, I should try to tap the well of your experience and knowledge.

    So if anyone has encountered this before and you have a solution, please
let me know.


Thanks


Thomas Vachuska