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