INTERFACEKeyTrans ;
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 tokey
.\medskip\bulletitem If
32 <= key <= 255
, then returnVAL(key, CHAR)
.\medskip\bulletitem If
key
isKey.Backspace
,Key.Tab
,Key.Return
,Key.Escape
, orKey.Delete
, then return the corresponding character.\medskip\bulletitem Otherwise return
NullKey
PROCEDURE TTY (READONLY cd: VBT.KeyRec): CHAR;
Similar toLatin1
, 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 returnVAL(1, CHAR)
.
END KeyTrans.