home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!osustat.mps.ohio-state.edu!dsb
- From: dsb@osustat.mps.ohio-state.edu (David S. Blumenthal)
- Newsgroups: comp.sys.mac.programmer
- Subject: Help using KMAP/KCHR from on-screen keyboard
- Date: 30 Dec 1992 22:10:22 GMT
- Organization: OSU Statistical Computing Laboratory
- Lines: 40
- Distribution: world
- Message-ID: <1ht6oeINN13b@zaphod.mps.ohio-state.edu>
- NNTP-Posting-Host: osustat.mps.ohio-state.edu
-
- The saga of the virtual keyboard continues...
-
- Does anyone have the formats for KMAP, KCHR, and KCOD resources? In my on-
- screen virtual keyboard, I need a quick and flexible way to translate mouse
- clicks into key down and key up events. Currently, I translate the mouse
- position into a box number, to serve as a raw key code. I need to use a
- KMAP resource to translate that into a virtual key code that will be passed
- to the system's KCHR resource for translation into ASCII.
-
- Questions:
-
- 1) What is the format of the KMAP resource, are there any ResEdit editors for
- them, and where can I find the standard virtual key codes that an American
- keyboard emulator should produce for each desired key?
-
- 2) What is the best way to translate virtual key codes into ASCII? Can I use
- KeyTrans, or should I deal directly with the system's KCHR? Is KeyTrans
- available on System 4.1 on a Plus? How do I deal with dead keys?
-
- 3) Once I have the correct virtual key code and ASCII value, how do I post
- the appropriate key event? Will PostEvent do what I want, or do I need
- something more modern or lower level to get the control I need?
-
- 4) How do I make the system ask me what modifier keys are down, not just for
- posted events, but for anything that checks?
-
-
- I would really like my keyboard to take over all the functionality of an
- external keyboard, to the extent that a general purpose application will not
- be able to tell the difference (obviously anything that deals with ADB will
- notice something wrong :-).
-
- Thanks for all the help. Slowly but surely this thing is taking shape.
-
- -Dave Blumenthal
-
- -----------------------------------------------------------------------
- | Dave Blumenthal | The Ohio State University |
- | dsb@osustat.mps.ohio-state.edu | Statistical Computing Laboratory |
- ------ There is a fine difference between insight and insanity. -------
-