home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13106 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  1.7 KB

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