-- File: KeyStations.mesa last edited by
-- Karlton; Oct 10, 1980 4:41 PM

KeyStations: DEFINITIONS =
  BEGIN

  DownUp: TYPE = {down, up};
  KeyBits: TYPE = PACKED ARRAY KeyStation OF DownUp;
  KeyStation: TYPE = [0..112);

  Bit: TYPE = KeyStation; -- for convenience

  -- Positions in Keyboard array correspond to "keystations" common to all keyboards.
  -- Higher-level software must associate characters with each keystation as appropriate.

  -- Keystations are of five types:
  --   1) Typing keys: (alphanumerics, punctuation, tab, CR, etc.)
  --   2) Function Keys: Left, right, and top function groups
  --   3) Mouse buttons
  --   4) Keyset (Not on OIS keyboards)
  --   5) Diagnostic (pseudo-keys for hardware diagnostic purposes)

  -- Main typing array

  k1: Bit = 48;
  k2: Bit = 35;
  k3: Bit = 37;
  k4: Bit = 33;
  k5: Bit = 56;
  k6: Bit = 34;
  k7: Bit = 36;
  k8: Bit = 32;
  k9: Bit = 40;
  k10: Bit = 19;
  k11: Bit = 21;
  k12: Bit = 17;
  k13: Bit = 53;
  k14: Bit = 64;
  k15: Bit = 51;
  k16: Bit = 16;
  k17: Bit = 23;
  k18: Bit = 65;
  k19: Bit = 66;
  k20: Bit = 18;
  k21: Bit = 55;
  k22: Bit = 67;
  k23: Bit = 68;
  k24: Bit = 20;
  k25: Bit = 70;
  k26: Bit = 22;
  k27: Bit = 54;
  k28: Bit = 69;
  k29: Bit = 71;
  k30: Bit = 39;
  k31: Bit = 25;
  k32: Bit = 38;
  k33: Bit = 43;
  k34: Bit = 41;
  k35: Bit = 42;
  k36: Bit = 24;
  k37: Bit = 58;
  k38: Bit = 27;
  k39: Bit = 59;
  k40: Bit = 26;
  k41: Bit = 28;
  k42: Bit = 74;
  k43: Bit = 44;
  k44: Bit = 75;
  k45: Bit = 45;
  k46: Bit = 61;
  k47: Bit = 107;
  k48: Bit = 97;

  A1: Bit = 50;
  A2: Bit = 31;
  A3: Bit = 72;
  A4: Bit = 60;
  A5: Bit = 57;
  A6: Bit = 76;
  A7: Bit = 73;
  A8: Bit = 88;
  A9: Bit = 86;
  A10: Bit = 108;
  A11: Bit = 110;
  A12: Bit = 111;

  -- Function key arrays (left, right, and top)

  L1: Bit = 85;
  L2: Bit = 91;
  L3: Bit = 62;
  L4: Bit = 84;
  L5: Bit = 90;
  L6: Bit = 30;
  L7: Bit = 83;
  L8: Bit = 89;
  L9: Bit = 63;
  L10: Bit = 82;
  L11: Bit = 52;
  L12: Bit = 78;

  R1: Bit = 79;
  R2: Bit = 92;
  R3: Bit = 106;
  R4: Bit = 94;
  R5: Bit = 80;
  R6: Bit = 47;
  R7: Bit = 93;
  R8: Bit = 109;
  R9: Bit = 81;
  R10: Bit = 87;
  R11: Bit = 46;
  R12: Bit = 77;

  T1: Bit = 98;
  T2: Bit = 49;
  T3: Bit = 99;
  T4: Bit = 100;
  T5: Bit = 101;
  T6: Bit = 102;
  T7: Bit = 103;
  T8: Bit = 104;
  T9: Bit = 29;
  T10: Bit = 105;

  -- Mouse Buttons (left to right)

  M1: Bit = 13;
  M2: Bit = 15;
  M3: Bit = 14;

  -- KeySet

  KS1: Bit = 8;
  KS2: Bit = 9;
  KS3: Bit = 10;
  KS4: Bit = 11;
  KS5: Bit = 12;

  -- Diagnostic keystations

  D1: Bit = 96;
  D2: Bit = 95;

  END.
-- LOG
-- Feb 6, 1980  5:59 PM	By: Redell	Created file
-- May 2, 1980  6:05 PM	By: Redell	Updated bit assignments
-- May 5, 1980  2:32 PM	By: Karlton	Change updown TYPE to DownUp
-- May 8, 1980  5:34 PM	By: Karlton	Reflect actual state of Level 4 double keys
-- May 10, 1980 1:35 PM	By: Karlton	Renamed to KeyStations & make Definitions Only
-- Oct 10, 1980 4:39 PM	By: Karlton	added A11 and A12