[Tutor] Re: Keyboard input (Joseph J. Strout
bowman
bowman@montana.com
Fri, 15 Oct 1999 23:00:38 -0600
>
> You don't. This is not possible in general. On certain platforms,
> certain key combinations may be possible to check for or trap in
> certain ways.
I believe the solution the original poster is looking for involves
threads. Typically, a long calculation would run as a separate thread.
With suitable semaphores in place, keyboard input can be handled, and a
semaphore raised if the background calculation should terminate itself.
Less elegant, one could just kill the thread.
It is true threads may not be usable on some of the more primitive OSes.
see section 7.4 of the library reference.