Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!ucbvax!hoser.berkeley.edu!bryce From: bryce@hoser.berkeley.edu (Bryce Nesbitt) Newsgroups: comp.sys.amiga Subject: Re: Repeating multiple keys Message-ID: <22036@ucbvax.BERKELEY.EDU> Date: Thu, 3-Dec-87 06:10:30 EST Article-I.D.: ucbvax.22036 Posted: Thu Dec 3 06:10:30 1987 Date-Received: Sun, 6-Dec-87 23:51:12 EST References: <209@dalcsug.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: bryce@hoser.berkeley.edu (Bryce Nesbitt) Organization: University of California at Berkeley Lines: 34 Keywords: How do I detect this? Summary: how to do this, and more on DeadKeyConvert() and RAWKEY In article <209@dalcsug.UUCP> peter@dalcsug.UUCP (Peter Philip) writes: >Can anyone tell me where I could find an example of detecting which keys >are being held down? I need this for a game I would like to write, so it has >to be quite fast and able to detect more than one key (like 'x' for turn >right and '/' for thrust) simultaneously. The only reference for doing > this that I could find was in the RKM under keyboard.device - which also >says not to use the keyboard.device directly!! For a game you want primarily *POSITIONAL* information. ie: thrust is to the left of fire. For this application Intution RAWKEYS are perfect. For *everyone else* RAWKEYS need to be converted by the ^^^^^^^^^^^^^^^ DeadKeyConvert() function. (Example comming soon to comp.sources.amiga and not-as-soon to a FISH disk near you) You need to tell Intution to send your program events of class RAWKEY. These will contain a code in the lower 7 bits, the high bit will tell you if the key was pressed or released. Keep track of this and you will know at any one moment what keys are down. The console.device chapter will have info on the codes. The Intuition manual will tell you how to get RAWKEY messages. >>REMEMBER: YOU ONLY USE RAW CODES FOR POSITIONAL CONTROL<< >>TEXT EDITORS, TERM PROGRAMS, AND ANYTHING<< >>ELSE USES RawKeyConvert() !!<< |\ /| . Ack! (NAK, SOH, EOT) {o O} . bryce@hoser.berkeley.EDU -or- ucbvax!hoser!bryce (") U WARNING: hoser's spool directory eats a *lot* of mail. :-(