qdevice and stuff.........

Thant Tessman thant at horus.esd.sgi.com
Fri Mar 30 05:13:08 AEST 1990


In article <1990Mar28.192724.26499 at cunixf.cc.columbia.edu>,
kaul at cunixa.cc.columbia.edu (Anil Kaul) writes:
> Hi,                                                                   
>    I have been trying to queue certain keys on the keyboard, but have 
> come up with a strange error:                                         
>    Whenever I press a key it seems to record two enteries in the event
> queue. It appears that one entry is for key being depressed and the
other       
> for the key while being released. Is it true or am I messing up
somewhere else?
> I would actually like to get only one entry everytime the key is
depressed.    
> Is there something I can do to avoid getting two enteries from each
key?        
>                                                                       

When you queue a button, and do:

	dev = qread(&val);

'dev' is set to the button number (as defined in "device.h"),
and 'val' is set to 1 if the button went down, and 0 if the
button went up.

If you only want ascii information from the keyboard, then
qdevice(KEYBD);  When a keyboard key is pressed, 'qread' will
set 'dev' to KEYBD and 'val' to the ascii value of the key.

Hope this helps,

thant



More information about the Comp.sys.sgi mailing list