home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20442 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  2.3 KB

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