Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!usc!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!ames!sgi!shinobu!odin!horus.esd.sgi.com!thant From: thant@horus.esd.sgi.com (Thant Tessman) Newsgroups: comp.sys.sgi Subject: Re: qdevice and stuff......... Message-ID: <5855@odin.corp.sgi.com> Date: 29 Mar 90 19:13:08 GMT References: <1990Mar28.192724.26499@cunixf.cc.columbia.edu> Sender: news@odin.corp.sgi.com Reply-To: thant@horus.esd.sgi.com (Thant Tessman) Organization: Silicon Graphics, Entry Systems Division Lines: 31 In article <1990Mar28.192724.26499@cunixf.cc.columbia.edu>, kaul@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