home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!mips!darwin.sura.net!convex!news.utdallas.edu!corpgate!bnrgate!bmers95!usenet
- From: ross@bnr.ca (Ross Brown)
- Subject: Re: Q: Checking for modif keys on app startup
- Message-ID: <1992Jul29.144320.18410@bmers95.bnr.ca>
- Sender: usenet@bmers95.bnr.ca
- Organization: Bell-Northern Research
- References: <1992Jul28.162138.9681@leland.Stanford.EDU> <70554@apple.Apple.COM> <Bs55zL.1GD@taligent.com>
- Date: Wed, 29 Jul 92 14:43:20 GMT
- Lines: 30
-
- In article <Bs55zL.1GD@taligent.com> keith@taligent.com (Keith Rollin) writes:
- >>[previous post deleted]
- >I don't really know if either method is better than the other. The only thing
- I
- >can think of is that some people (myself included) have a hard time trying to
- >figure out how to read the KeyMap variable (I program in C, which defines
- KeyMap
- >as 4 longs, and not a packed array of 128 Booleans).
-
- How often do I get the chance to help Keith Rollin out? :-)
-
- Boolean IsKeyDown( short keyCode )
- {
- char keyMap[ 16 ];
-
- GetKeys( (KeyMap) keyMap );
-
- if( keyMap[ keyCode >> 3 ] & ( 1 << ( keyCode & 0x7 ) ) )
- return true;
- else
- return false;
-
- }
-
- W. Ross Brown | from Brown's Dictionary of Psychic Kinematics:
- Advisor, Telemanagement Svcs. | ex-hil'a-ra'tion (n.)
- Bell-Northern Research Ltd. | The rate of change of felicity.
- Ottawa, Ontario, Canada | ----------------------------------------------
- ross@bnr.ca | Any opinion expressed is mine, not BNR's.
-
-