Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!nuchat!uhnix1!sugar!peter
From: peter@sugar.UUCP (Peter da Silva)
Newsgroups: comp.sys.amiga
Subject: Re: Repeating multiple keys
Message-ID: <1213@sugar.UUCP>
Date: Thu, 3-Dec-87 07:04:31 EST
Article-I.D.: sugar.1213
Posted: Thu Dec  3 07:04:31 1987
Date-Received: Wed, 9-Dec-87 07:26:57 EST
References: <209@dalcsug.UUCP>
Organization: Sugar Land UNIX - Houston, TX
Lines: 23
Keywords: How do I detect this?
Summary: Use the input device.

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? ...  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!!

Open a window with IDCMP flags set to include RAWKEY.

When you get a key message...

	while(msg = GetMsg(win->UserPort))
		switch(msg->Class) {
			case RAWKEY:
				key_down[msg->Code & 0x7F] =
					(msg->Code & 0x80)?0:1;
				break;
		}

I'm doing this... quite fast. You do this rother than using the keyboard.device
directly because you want to be intuition-friendly. Don't you?
-- 
-- Peter da Silva  `-_-'  ...!hoptoad!academ!uhnix1!sugar!peter
-- Disclaimer: These U aren't mere opinions... these are *values*.