[net.micro.mac] Dead Keys

lsr@apple.UUCP (Larry Rosenstein) (07/29/86)

{}

A long time ago there was a discussion of using the Option key as Control in
Red Ryder.  The problem is that certain option key combinations (eg.,
Option-e) are dead keys and don't generate a character until the next key is
typed.  

Contrary to the messages posted at the time, it is very easy to disable
dead keys in the keyboard driver (although I'm not sure that this has been
documented).  MacTerminal does it, in fact.

Basically, there are 2 resources (pieces of code, actually) that map raw
keycodes, generated by the keyboard, into ASCII characters.  One resource
handles the main keyboard and the other the external keypad.  It is
possible to completely replace these resources if you want to modify the
mapping in some unusual way.

Turning off dead keys, however, is very easy and already provided in the
system.  Low memory location $29E contains the address of the main mapping
function.  The resource begins with a 2-byte BRA instruction, followed by a
1-byte flag.

If the flag is $FF then dead keys are on, if it is $00, then dead keys are
off (ie., typing option-E will give you an accent character immediately).
It's as easy as that.  Programs that turn off dead keys should make sure to
re-enable them when they terminate.

It would be trivial to write a desk accessory that allows you to
enable/disable dead keys at any time.  Then it might be more convenient to
use the Option key in Red Ryder.

I hope this helps current and future terminal emulators.

-- 
Larry Rosenstein

Object Specialist
Apple Computer

AppleLink: Rosenstein1
UUCP:  {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.CSNET

naftoli@aecom.UUCP (Robert N. Berlinger) (07/30/86)

> It would be trivial to write a desk accessory that allows you to
> enable/disable dead keys at any time.  Then it might be more convenient to
> use the Option key in Red Ryder.

Or better, get Scott Watson to put into Red Ryder, which, at the 
rate he goes, will probably happen faster :-).  
-- 
Robert Berlinger
Systems Analyst
Albert Einstein College of Medicine

UUCP:       ...{philabs,cucard,pegasus,ihnp4,rocky2}!aecom!naftoli
Compuserve: 73047,741

lsr@apple.UUCP (Larry Rosenstein) (07/30/86)

{}

*WARNING*

After I posted my article about dead keys, I was informed by people
"in-the-know" that the trick I mentioned for turning off dead key
processing IS NOT SUPPORTED.  This means it is subject to change in future
system software.

So, although the trick does work with System 3.2, you should not rely on it
in your applications, otherwise you may encounter problems in the future.

Sorry for the misinformation,

Larry
-- 
Larry Rosenstein

Object Specialist
Apple Computer

AppleLink: Rosenstein1
UUCP:  {sun, voder, nsc, mtxinu, dual}!apple!lsr
CSNET: lsr@Apple.CSNET