[comp.sys.sgi] Event queue question - non-block keyboard read reply

tjh@bu-pub.bu.edu (Tim Hall) (06/14/90)

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@thorin.cs.unc.edu> taylorr@glycine.cs.unc.edu (Russell Taylor) writes:
>>	I want to do non-blocking keyboard I/O in a program.  Basically, the

Archer Sully (archer@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@bu-pub.bu.edu