Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!intercon!amanda@intercon.com From: amanda@intercon.com (Amanda Walker) Newsgroups: comp.sys.mac.programmer Subject: Re: Option Key and the Keyboard Driver, Red Ryder Message-ID: <1578@intercon.com> Date: 28 Nov 89 23:28:03 GMT References: Sender: news@intercon.com Reply-To: amanda@intercon.com (Amanda Walker) Lines: 18 There are two approaches you can take. The first is to create a custom KCHR resource. KCHR resources determine the mappings between keystrokes (including modifier keys and 'dead key' sequences) and the codes that are reported in keyDown events. You can tell the system to use your nifty new KCHR by using the Script Manager call "KeyScript" (see IM V for more information). The other approach is dirtier but simpler for some applications. The idea is that you do a head patch on the "KeyTrans" trap, which is what takes keystrokes and maps them by means of the currently active KCHR. KeyTrans gets the virtual keycode and the current state of the modifier keys as arguments. We use this to pretend the Option key is a Control key on non-ADB keyboards, for example, by swapping the values of the Control and Option bits. Once again, IM V should cover this. Amanda Walker InterCon Systems Corporation amanda@intercon.com --