I'm trying to detect when a user presses a specific key for a console program in Solaris (without first pressing enter). My searches online have shown that this is really simple in DOS/Windows, which has access to conio.h and the getch() function, which does exactly what I need.
My search has been fruitless, for the most part, on the UNIX side of things. Keyboard handling seems to consist of ugly hacks. Is there a fairly simple way of detecting keypresses that someone could clue me in on? All I want to do with this is detect when a special character is hit, terminate all threads, and exit.
Thanks in advance
My search has been fruitless, for the most part, on the UNIX side of things. Keyboard handling seems to consist of ugly hacks. Is there a fairly simple way of detecting keypresses that someone could clue me in on? All I want to do with this is detect when a special character is hit, terminate all threads, and exit.
Thanks in advance