Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!mips!apple!portal!sv!news From: leonardr@sv.portal.com (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: Pseudo control key for a Plus? Message-ID: <1991May31.204332.4411@svc.portal.com> Date: 31 May 91 20:43:32 GMT References: <1991May29.140048.47146@vaxb.acs.unt.edu> Sender: usenet@svc.portal.com Reply-To: leonardr@sv.portal.com (Leonard Rosenthol) Organization: Software Ventures Corporation Lines: 30 Nntp-Posting-Host: 192.42.172.96 In article <1991May29.140048.47146@vaxb.acs.unt.edu>, kenc@vaxb.acs.unt.edu writes: > From: kenc@vaxb.acs.unt.edu > Newsgroups: comp.sys.mac.programmer > Subject: Pseudo control key for a Plus? > Date: 29 May 91 13:54:48 GMT > Organization: University of North Texas > > I'm looking for a little advice on how to go about patching the keyboard event > mechanism on a Plus... > > Basically, what I want to do is set the ctrl-key bit if the command and option > (or some other combination) are held down that the same time. > > Matter of fact, I'll need to do this before the key gets decoded, for it to do > much good. > > Would it just be easier to define my own kCHR resource? > > Thanks in advance. > Although you COULD do it with a KCHR resource, folks running with their own keyboard layouts - like ANYONE with a non English/Roman system - would get REAL UPSET at you... The correct way to do this is to patch _KeyTrans which is the trap which handles the 'mapping' of raw keycodes & modifiers into the events that the program gets via GNE/WNE. In the patch just check for you set of modifiers and then switch it to the control key instead...The only caveat of this whole process is that the Process Manager will swap your patch out EVEN DURING A MINOR CONTEXT SWITCH, so you have either a) live it with or b) munch the in memory KCHR to handle it. b is the correct, though diff icult solution, which we do for MicroPhone II, however a will work for most. ---------------------------------------------------------------------- + Leonard Rosenthol | AppleLink: MACgician + + Software Ventures | GEnie: MACgician + + Internet: leonardr@sv.portal.com | AOL: MACgician + ----------------------------------------------------------------------