, <netbsd-help@netbsd.org>
From: Bruce Martin <brucem@cat.co.za>
List: netbsd-help
Date: 12/04/2001 15:28:17
Just a standard text application. poll() does exactly what I am trying to
achieve, thanks for the help to you and Matthias!
On Tuesday 04 December 2001 15:03, Richard Rauch wrote:
> Detecting a key press depends on the context.
>
> Are you at a text console (either without running X, or running in an
> xterm---over even over a ssh link)? Or do you want to set up your own X
> window? Or are you using GLUT with the OpenGL? Or some other toolkit?
>
> In a windowing situation, this tends to be easier, since you get varous
> event messages (or callbacks). In a text-based application, one way to do
> it is to put the tty into ``raw'' mode, and spin off a seperate process to
> wait on input while the other process starts your endless ``determine the
> meaning of life loop''. When input comes to the first process, it can
> then signal the looping process, and both can exit.
>
> That's not a terribly elegant solution, but it should work. (^&
>
>
> ``I probably don't know what I'm talking about.'' --rauch@math.rice.edu