home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / mac / programm / 14353 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!ucsbcsl!mcl!scott
  2. From: scott@mcl.ucsb.edu (Scott Bronson)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: How to describe a keypress?  Should be easy...
  5. Summary: How do you describe a keypress?
  6. Keywords: Keyboard keypress
  7. Message-ID: <scott.714447835@mcl>
  8. Date: 22 Aug 92 01:43:55 GMT
  9. Sender: root@ucsbcsl.ucsb.edu
  10. Lines: 20
  11.  
  12. I have a headache because I've been beating my head into this wall for the
  13. past two days.  I took on the task of writing an INIT that will launch an
  14. application at the press of a user-specified hot key.  The INIT and cdev
  15. are working great, and everything is perfect EXCEPT:
  16.  
  17. How do you describe a keypress?  I can't use char codes, as keyboards
  18. change too much.  Can't use key codes, as there are duplications (esc
  19. and clear, for example).  From the volumes that I've read looking for
  20. the answer, I can see that there's a KCHR resource and a _KeyTrans trap
  21. that I'd be interested in, but how do I use them?
  22.  
  23. How do I get my application to display "Shift-7" when the user types "&"?
  24. How do I get it to work with all Macintosh keyboards?  Thanks for any help.
  25.  
  26.     - Scott
  27.  
  28. Incidentally, I've isolated the routine in Norton's KeyFinder that does
  29. the translation for them.  It's 53 pages of raw assembly source involving
  30. a huge amount of comparisons to a particular char code.  That's when I
  31. decided that there MUST be an easier solution.
  32.