Event queue question - non-block keyboard read reply
Tim Hall
tjh at bu-pub.bu.edu
Thu Jun 14 13:19:13 AEST 1990
Is there an event caused when one window is opened on top of another
window that references the bottom window? For example, a REDRAW event
that gives the gid of the bottom window. I read through the manual,
tried the REDRAW and DEPTHCHANGE events...nothing... :-(
In reference to the non-blocking keyboard reading...
In article <14670 at thorin.cs.unc.edu> taylorr at glycine.cs.unc.edu (Russell Taylor) writes:
>> I want to do non-blocking keyboard I/O in a program. Basically, the
Archer Sully (archer at esd.sgi.com)
>Check out 'Advanced UNIX(tm) Programming' by Marc Rochkind. It contains
If you aren't concerned about portability then this is very easy to do
using the gl event queue. First you have to queue the keyboard with the
call "qdevice( KEYBOARD )" then you could do somthing like...
char
read_keyboard( )
{
int ret;
short val;
/* non-blocking test of the first value in the event queue */
ret = qtest( );
if ( ret != KEYBOARD )
return( NULL );
/* 'val' gets the ASCII value of the keyboard key */
qread( &val );
return( (char)val );
}
Of course you have to deal with the non-keyboard events somewhere
else in the code.
-Tim Hall
tjh at bu-pub.bu.edu
More information about the Comp.sys.sgi
mailing list