TIPKeyboardsImpl.mesa
Copyright Ó 1988, 1990, 1991 by Xerox Corporation. All rights reserved.
Bier, May 3, 1990 9:42 am PDT
JKF, May 30, 1990 9:05:24 am PDT
Willie-s, October 11, 1991 2:34 pm PDT
Doug Wyatt, December 19, 1991 12:32 pm PST
Christian Jacobi, April 23, 1992 3:40 pm PDT
Contents: Contains routines that deal with TIP's understanding of keyboards, both virtual and actual.
DIRECTORY KeySyms1, KeySymsKB, KeySymsPublish, KeySymsCedar, KeySymsPrincOpsConvention, KeyTypes, TIPKeyboards, SpecialKeySyms;
TIPKeyboardsImpl: CEDAR PROGRAM
EXPORTS TIPKeyboards = BEGIN
KeySym: TYPE = KeyTypes.KeySym;
LeftMouse: KeySym = SpecialKeySyms.Button1;
MiddleMouse: KeySym = SpecialKeySyms.Button2;
RightMouse: KeySym = SpecialKeySyms.Button3;
EmDash: KeySym = KeySymsPublish.EmDash;
Old Code Describing the Dorado Keyboard
KeyItem: TYPE ~ RECORD[normal, shift: KeySym] ¬ [[0], [0]];
nullKeyItem: KeyItem ~ [[0], [0]];
DefaultingKeyItem: TYPE ~ KeyItem ¬ nullKeyItem;
KeyTable: TYPE ~ ARRAY KeyName OF DefaultingKeyItem;
keyTable: PUBLIC REF KeyTable;
KeyCode: TYPE = KeyTypes.KeyCode;
KeySymsFromKeyCode: PUBLIC PROC [keyCode: KeyCode] RETURNS [keySym1, keySym2: KeySym, success: BOOL ¬ TRUE] = {
keyItem: KeyItem;
IF keyCode > VAL[111] THEN RETURN[nullKeySym,nullKeySym,FALSE];
keyItem ¬ keyTable[VAL[ORD[keyCode]]];
keySym1 ¬ keyItem.normal;
keySym2 ¬ keyItem.shift;
};
nullKeySym: KeySym = [0];
InitKeyMappings: PROC = {
OPEN KeySyms1, KeySymsKB, KeySymsPrincOpsConvention;
The old table for the Cedar keyboard:
keyTable ¬ NEW[KeyTable ¬ [
Unused0: [Unused0, Unused0],
Unused1: [Unused1, Unused1],
Unused2: [Unused2, Unused2],
Unused3: [Unused3, Unused3],
Unused4: [Unused4, Unused4],
Unused5: [Unused5, Unused5],
Unused6: [Unused6, Unused6],
Pen: [Pen, Pen],
Keyset1: [Keyset1, Keyset1],
Keyset2: [Keyset2, Keyset2],
Keyset3: [Keyset3, Keyset3],
Keyset4: [Keyset4, Keyset4],
Keyset5: [Keyset5, Keyset5],
Point: [LeftMouse, LeftMouse],
Adjust: [RightMouse, RightMouse],
Menu: [MiddleMouse, MiddleMouse],
Zero: [Zero, RightParen], -- 0 and )
One: [One, Exclamation], -- 1 and !
Two: [Two, AtSign], -- 2 and @
Three: [Three, NumberSign], -- 3 and #
Four: [Four, DollarSign], -- 4 and $
Five: [Five, PercentSign], -- 5 and %
Six: [Six, Tilde], -- 6 and ~
Seven: [Seven, Ampersand], -- 7 and &
Eight: [Eight, Asterisk], -- 8 and *
Nine: [Nine, LeftParen], -- 9 and (
Q: [q, Q],
W: [w, W],
E: [e, E],
R: [r, R],
T: [t, T],
Y: [y, Y],
U: [u, U],
I: [i, I],
O: [o, O],
P: [p, P],
A: [a, A],
S: [s, S],
D: [d, D],
F: [f, F],
G: [g, G],
H: [h, H],
J: [j, J],
K: [k, K],
L: [l, L],
Z: [z, Z],
X: [x, X],
C: [c, C],
V: [v, V],
B: [b, B],
N: [n, N],
M: [m, M],
Dash: [Hyphen, EmDash], -- Alto - and %, DLion -
Slash: [Slash, KeySyms1.QuestionMark], -- / and ?
BackSlash: [BackSlash, VerticalBar], -- Alto \ and |, DLion DEFAULTS (top row, right end)
PASTE: [LF, LF], -- Alto LF (upper right), DLion COPY (left group)
BS: [BS, BS], -- Alto BS (upper right), DLion ¬ (large key, upper right)
Comma: [Comma, LessThanSign], -- , and <
Quote: [Apostrophe, QuotationMark], -- ' and " (close quotes on DLion)
RightBracket: [RightBracket, RightCurly], -- ] and }
STUFF: [Next, Next], -- Spare2
COMMAND: [KeySymsCedar.Look, KeySymsCedar.Look], -- Spare1
COMPLETE: [ESC, ESC], -- Alto ESC (upper left), DLion CENTER (top row, left end)
TAB: [TAB, TAB], -- Alto TAB, DLion <paratab> (large key left of Q)
CONTROL: [LeftControl, LeftControl],
LeftShift: [LeftShift, LeftShift],
Period: [Period, GreaterThanSign], -- . and >
SemiColon: [SemiColon, Colon], --; and :
Return: [Return, Return], -- Alto RETURN, DLion <newpara> (double-height key, right side)
Arrow: [LeftArrow, UpArrow], -- Alto ← and ^, DLion open quotes
DELETE: [Delete, Delete], -- Alto DEL, DLion DELETE (left group)
NEXT: [Move, Move], -- DLion MOVE (left group)
LOCK: [KeySymsKB.CapsLock, KeySymsKB.CapsLock],
Space: [Space, Space], -- the space bar
LeftBracket: [LeftBracket, LeftCurly], -- [ and {
Equal: [Equal, PlusSign], -- = and +
RightShift: [RightShift, RightShift],
USERABORT: [KeySymsCedar.Swat, KeySymsCedar.Swat], -- Spare3
MOVE: [Move, Move],
UNDO: [Undo, Undo],
DOIT: [Execute, Execute],
R9: [R9, R9],
L10: [L10, L10],
L7: [L7, L7],
L4: [L4, L4],
L1: [L1, L1],
A9: [A9, A9],
R10: [R10, R10],
A8: [A8, A8],
COPY: [Copy, Copy],
FIND: [Find, Find],
AGAIN: [Again, Again],
HELP: [Help, Help],
EXPAND: [Expand, Expand],
R4: [R4, R4],
D2: [D2, D2],
D1: [D1, D1],
MENU: [Menu, Menu],
T1: [T1, T1],
SCROLLBAR: [Bold, Bold],
JFIRST: [Italics, Italics],
JSELECT: [Underline, Underline],
RESERVED: [Superscript, Superscript],
CLIENT1: [Subscript, Subscript],
CLIENT2: [LargerSmaller, LargerSmaller],
T10: [T10, T10],
R3: [R3, R3],
Key47: [Key47, Key47],
A10: [A10, A10],
ATTENTION: [Attention, Attention],
A11: [A11, A11],
A12: [A12, A12]
]];
};
The old Terminal Defs key names
KeyName: TYPE ~ MACHINE DEPENDENT {
Unused0(0), -- unused
Unused1(1), -- unused
Unused2(2), -- unused
Unused3(3), -- unused
Unused4(4), -- unused
Unused5(5), -- unused
Unused6(6), -- unused
Pen(7), -- Pen switch, for graphics tablet
Keyset1(8), -- Alto keyset 1 (leftmost)
Keyset2(9), -- Alto keyset 2
Keyset3(10), -- Alto keyset 3
Keyset4(11), -- Alto keyset 4
Keyset5(12), -- Alto keyset 5
Point(13), -- Mouse, left button
Adjust(14), -- Mouse, right button
Menu(15), -- Mouse, middle button
Five(16), -- 5 and %
Four(17), -- 4 and $
Six(18), -- 6 and ~
E(19),
Seven(20), -- 7 and &
D(21),
U(22),
V(23),
Zero(24), -- 0 and )
K(25),
Dash(26), -- Alto - and , DLion -
P(27),
Slash(28), -- / and ?
BackSlash(29), -- Alto \ and |, DLion DEFAULTS (top row, right end)
PASTE(30), -- Alto LF (upper right), DLion COPY (left group)
BS(31), -- Alto BS (upper right), DLion ← (large key, upper right)
Three(32), -- 3 and #
Two(33), -- 2 and @
W(34),
Q(35),
S(36),
A(37),
Nine(38), -- 9 and (
I(39),
X(40),
O(41),
L(42),
Comma(43), -- , and <
Quote(44), -- ' and " (close quotes on DLion)
RightBracket(45), -- ] and }
STUFF(46), -- Alto "Next" (blank key right of RETURN), DLion KEYBOARD (right group)
COMMAND(47), -- Alto "Look" (blank key right of BS), DLion UNDO (right)
One(48), -- 1 and !
COMPLETE(49), -- Alto ESC (upper left), DLion CENTER (top row, left end)
TAB(50), -- Alto TAB, DLion <paratab> (large key left of Q)
F(51),
CONTROL(52), -- Alto CTRL (large key left of A), DLion OPEN (left group)
C(53),
J(54),
B(55),
Z(56),
LeftShift(57), -- SHIFT, lower left
Period(58), -- . and >
SemiColon(59), -- ; and :
Return(60), -- Alto RETURN, DLion <newpara> (double-height key, right side)
Arrow(61), -- Alto ¬ and ­, DLion open quotes
DELETE(62), -- Alto DEL, DLion DELETE (left group)
NEXT(63), -- DLion MOVE (left group)
R(64),
T(65),
G(66),
Y(67),
H(68),
Eight(69), -- 8 and *
N(70),
M(71),
LOCK(72), -- LOCK (Alto lower left corner, DLion left of A)
Space(73), -- the space bar
LeftBracket(74), -- [ and {
Equal(75), -- = and +
RightShift(76), -- SHIFT, lower right
USERABORT(77), -- Alto "Swat" (lower right corner), DLion STOP (red key, right group)
MOVE(78), -- DLion PROP'S (left group)
UNDO(79), -- DLion SKIP/NEXT (right group)
DOIT(80), -- DLion MARGINS (right group)
R9(81),
L10(82),
L7(83),
L4(84),
L1(85),
A9(86),
R10(87),
A8(88),
COPY(89), -- DLion SAME (left group)
FIND(90), -- DLion FIND (left group)
AGAIN(91), -- DLion AGAIN (left group)
HELP(92), -- DLion HELP (right group)
EXPAND(93), -- DLion DEF'N/EXPAND (right group)
R4(94),
D2(95),
D1(96),
MENU(97), -- DLion <tab> (upper left corner, engraved with right-pointing arrow)
T1(98),
SCROLLBAR(99), -- DLion BOLD (top row)
JFIRST(100), -- DLion ITALICS (top row)
JSELECT(101), -- DLion UNDERLINE (top row)
RESERVED(102), -- DLion SUPERSCRIPT (top row)
CLIENT1(103), -- DLion SUBSCRIPT (top row)
CLIENT2(104), -- DLion LARGER/SMALLER (top row)
T10(105),
R3(106),
Key47(107),
A10(108), -- DLion FONT (right group)
ATTENTION(109),
A11(110),
A12(111)
};
InitKeyMappings[];
END.