etext/src/KeyTrans.i3


Copyright (C) 1994, Digital Equipment Corp.

INTERFACE KeyTrans;
KeyTrans is a utility interface that provides some standard mapping between keyboard keys and ASCII characters.

IMPORT VBT;

CONST
  NullKey = '\000';

PROCEDURE Latin1 (key: VBT.KeySym): CHAR;
Return the ISO-Latin-1 character corresponding to key.

\medskip\bulletitem If 32 <= key <= 255, then return VAL(key, CHAR).

\medskip\bulletitem If key is Key.Backspace, Key.Tab, Key.Return, Key.Escape, or Key.Delete, then return the corresponding character.

\medskip\bulletitem Otherwise return NullKey


PROCEDURE TTY (READONLY cd: VBT.KeyRec): CHAR;
Similar to Latin1, but if this is a control key, then clear the ``high-order bits'' from the character code. For example, for both control-a and control-A, we return VAL(1, CHAR).

END KeyTrans.