home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!apple!apple!mlanett
- From: mlanett@Apple.COM (Mark Lanett)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Q: Checking for modif keys on app startup
- Message-ID: <70554@apple.Apple.COM>
- Date: 28 Jul 92 17:59:48 GMT
- References: <1992Jul28.162138.9681@leland.Stanford.EDU>
- Organization: Apple Computer Inc., Cupertino, CA
- Lines: 28
-
- felciano@summit.stanford.edu (Ramon M. Felciano) writes:
-
- >I'm writing a 7.0 drag-and-drop application, and would like a "power
- >user" mode that does some automatic stuff if the user drops files on
- >the application while holding a particular key down (most likely
- >command or control). While I know how to check the modifier flags in an
- >event record, I'm not quite sure how to forcibly read the keyboard. Any
- >suggestions?
-
- pascal void GetKeys(KeyMap theKeys)
- = 0xA976; File {CIncludes}Events.h Inside Macintosh reference:
- I-259 Trap number: A976 Moves or purges memory. GetKeys reads the
- current state of the keyboard (and keypad, if any) and returns it in
- the form of a keyMap:
-
- TYPE KeyMap = PACKED ARRAY[0..127] OF BOOLEAN;
-
- Each key on the keyboard or keypad corresponds to an element in the
- keyMap. The index into the keyMap for a particular key is the same as
- the key code for that key. (The key codes are shown in Figure 3 above.)
- The keyMap element is TRUE if the corresponding key is down and FALSE
- if it isn't. The maximum number of keys that can be down simultaneously
- is two character keys plus any combination of the four modifier keys.
-
- You owe the Oracle the text from Inside Macintosh.
- --
- Have a bajillion brilliant Jobsian lithium licks.
- Mark Lanett, NOT speaking for anyone. Personal opinion only.
-