KeyTrans
KeyTrans Map virtual key codes to ASCII values
#include <OSUtils.h> Event Manager
long KeyTrans(transData, keycode, state );
const void *transData ; pointer to a 'KCHR' resource
short keycode ; the key's virtual key code
long *state ; toolbox maintained value relating to 'KCHR'
returns ASCII value(s) for a key
KeyTrans is a routine specific to the new 256K ROM and is used for
converting the key codes that appear in keyboard events (virtual key codes)
into ASCII values.
transData is a pointer to a 'KCHR' resource which is designed for mapping key
codes into their ASCII equivalents. See the description of the
Resource Manager for more information.
keycode is a 16-bit integer in which the first 7 bits (0-6) contain the
keyboard event codes, bit 7 indicates whether the key was pressed
down (0) or released (1). Bits 8 through 15 are the high byte of a
modifier flag.
state is a Toolbox parameter that indicates the 'KCHR' resource. It should
be reset to 0 if your application changes transData to point to a
different 'KCHR'.
Returns: a 32-bit long containing four 8-bit bytes as follows(high byte
first):
Reserved 1 Reserved for future "16-bit ASCII" for the ASCII 1
character
ASCII 1 the ASCII character code of the first letter the key
represents
Reserved 2 Reserved for future "16-bit ASCII" for the ASCII 2
character
ASCII 2 the ASCII character code for the second letter the key
generates, for example, a ~ over some characters in
Spanish.

Notes: Assembly programmers should call KeyTrans with the _KeyTrans macro,
with parameters passed on the stack.