[comp.sys.mac.programmer] modifiers with menu keys

jrk@sys.uea.ac.uk (Richard Kennaway) (06/24/91)

Recently someone posted some code for correctly handling option-command
keystrokes (e.g. making option-command-O invoke your command-O menu
command, irrespective of the nationality of the System).

I mislaid it, but I believe I have managed to reconstruct it from memory
and the Script Manager chapter: you get the KCHR resource for the Roman
script with GetScript( smRoman, smScriptKeys ) and supply it to KeyTrans
with the keyCode (no modifiers) from the event record.  This delivers the
charCode to pass to MenuKey.  (In principle, KeyTrans might return a pair
of character codes, but I don't want to think about that...unless someone
can assure me it can't happen in this case.)

Questions:

1.      How do you get the right KCHR if the Script Manager isn't
running?  Is its resource id hidden in an itl-something resource in the
System?  I've lost track of all the different flavours of itl* and ITL*.
Poking around in the System file shows that on my Mac, the relevant KCHR
is no.2.  I expect it's no coindicence at all that this is the constant
associated with a British System.  Where is this constant to be found?

2.	Why smRoman?  Are menus necessarily drawn with the Roman script on
all Macs?

3.	Does the call of GetScript return a pointer to the KCHR info or a
handle to the KCHR resource?  Does KeyTrans expect a pointer or a handle? 
(Its declaration in the MPW interface files represents it as taking a Ptr.)

--
Richard Kennaway          SYS, University of East Anglia, Norwich, U.K.
Internet:  jrk@sys.uea.ac.uk            uucp:  ...mcsun!ukc!uea-sys!jrk