Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!brazos.rice.edu!pete From: pete@titan.rice.edu (Pete Keleher) Newsgroups: comp.sys.mac.programmer Subject: Re: Option Key and Amanda's Solutions Message-ID: Date: 30 Nov 89 17:25:37 GMT References: <32889@ucbvax.BERKELEY.EDU> Sender: root@rice.edu Distribution: comp Organization: Whatsamatta U Lines: 70 In-reply-to: oster@dewey.soe.berkeley.edu's message of 30 Nov 89 06:39:24 GMT Point about A5 well taken. However, the a5 routines (as I am using them) don't seem to make the difference. So there were at least two major problems, not one. To test this out, I build an application and ran it under the uni-finder, getting exactly the same results. Are my transKey parameters wrong? I used LSC's CallPascalL and patched TickCount() and everything worked fine. Current code: static __GetA5() { asm { bsr.s @1 dc.l 0 ; store A5 here @1 move.l (sp)+,a1 } } #define pRememberA5() __GetA5(); asm { move.l A5,(a1) } #define pRememberA0() __GetA5(); asm { move.l a0,(a1) } #define pSetUpA5() asm { move.l A5,-(sp) } __GetA5(); asm { move.l (a1),A5 } #define pRestoreA5() asm { move.l (sp)+,A5 } .... .... pRememberA5(); keyTransAddr = NGetTrapAddress((int)0xac93,ToolTrap); NSetTrapAddress(keyTransHeadPatch,(int)0xac93,ToolTrap); if (NGetTrapAddress((int)0xac93,ToolTrap) != (long)keyTransHeadPatch) { SysBeep(1); Debugger(); } .... .... pascal long keyTransHeadPatch(transData, theKeyCode, myState) char *transData; int theKeyCode; long *myState; { int option_mask; int control_mask; long res; pSetUpA5(); option_mask = theKeyCode & optionKey; control_mask = theKeyCode & controlKey; theKeyCode &= ~(optionKey | controlKey); theKeyCode |= (option_mask << 1) | (control_mask >> 1); res = CallPascalL(transData, theKeyCode, myState, keyTransAddr); pRestoreA5(); return(res); } -- =========================================================================== Pete Keleher pete@titan.rice.edu Rice University knows nuttin about what I say, or what I do ... ===========================================================================