|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 3.2 ! 3: * Copyright (c) 1982, 1991 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * U.S. standard AT keyboard code table. ! 8: * ! 9: * See header files for definitions and constants. ! 10: * ! 11: * Version: 1.0, 05/31/91 ! 12: */ ! 13: #include "kbscan.h" ! 14: #include "kb.h" ! 15: ! 16: char tbl_name[] = "U.S. AT keyboard table"; ! 17: ! 18: KBTBL kbtbl[] = { ! 19: /* AT Alt ! 20: *Phys Ctrl Alt Alt Ctrl Alt ! 21: *Key# Base Shift Ctrl Shift Alt Shift Ctrl Shift Graphic Flags ! 22: *---- ---- ----- ---- ----- --- ----- ---- ----- ------- -----*/ ! 23: {K_1, '`', '~', none, none, '`', '~', none, none, none, O|T }, ! 24: {K_2, '1', '!', none, none, '1', '!', none, none, none, O|T }, ! 25: {K_3, '2', '@', nul, nul, '2', '@', nul, nul, none, O|T }, ! 26: {K_4, '3', '#', none, none, '3', '#', none, none, none, O|T }, ! 27: {K_5, '4', '$', none, none, '4', '$', none, none, none, O|T }, ! 28: {K_6, '5', '%', none, none, '5', '%', none, none, none, O|T }, ! 29: {K_7, '6', '^', rs, rs, '6', '^', rs, rs, none, O|T }, ! 30: {K_8, '7', '&', none, none, '7', '&', none, none, none, O|T }, ! 31: {K_9, '8', '*', none, none, '8', '*', none, none, none, O|T }, ! 32: {K_10, '9', '(', none, none, '9', '(', none, none, none, O|T }, ! 33: {K_11, '0', ')', none, none, '0', ')', none, none, none, O|T }, ! 34: {K_12, '-', '_', us, us, '-', '_', us, us, none, O|T }, ! 35: {K_13, '=', '+', none, none, '=', '+', none, none, none, O|T }, ! 36: /* key 14 undefined */ ! 37: {K_15, bs, bs, del, del, bs, bs, del, del, none, O|T }, ! 38: {K_16, f42, f43, none, none, f42, f43, none, none, none, F|T }, ! 39: {K_17, 'q', 'Q', dc1, dc1, 'q', 'Q', dc1, dc1, none, C|T }, ! 40: {K_18, 'w', 'W', etb, etb, 'w', 'W', etb, etb, none, C|T }, ! 41: {K_19, 'e', 'E', enq, enq, 'e', 'E', enq, enq, none, C|T }, ! 42: {K_20, 'r', 'R', dc2, dc2, 'r', 'R', dc2, dc2, none, C|T }, ! 43: {K_21, 't', 'T', dc4, dc4, 't', 'T', dc4, dc4, none, C|T }, ! 44: {K_22, 'y', 'Y', em, em, 'y', 'Y', em, em, none, C|T }, ! 45: {K_23, 'u', 'U', nak, nak, 'u', 'U', nak, nak, none, C|T }, ! 46: {K_24, 'i', 'I', ht, ht, 'i', 'I', ht, ht, none, C|T }, ! 47: {K_25, 'o', 'O', si, si, 'o', 'O', si, si, none, C|T }, ! 48: {K_26, 'p', 'P', dle, dle, 'p', 'P', dle, dle, none, C|T }, ! 49: {K_27, '[', '{', esc, esc, '[', '{', esc, esc, none, O|T }, ! 50: {K_28, ']', '}', gs, gs, ']', '}', gs, gs, none, O|T }, ! 51: {K_29, '\\', '|', fs, fs, '\\', '|', fs, fs, none, O|T }, ! 52: {K_30, caps, caps, caps, caps, caps, caps, caps, caps, caps, S|M }, ! 53: {K_31, 'a', 'A', soh, soh, 'a', 'A', soh, soh, none, C|T }, ! 54: {K_32, 's', 'S', dc3, dc3, 's', 'S', dc3, dc3, none, C|T }, ! 55: {K_33, 'd', 'D', eot, eot, 'd', 'D', eot, eot, none, C|T }, ! 56: {K_34, 'f', 'F', ack, ack, 'f', 'F', ack, ack, none, C|T }, ! 57: {K_35, 'g', 'G', bel, bel, 'g', 'G', bel, bel, none, C|T }, ! 58: {K_36, 'h', 'H', bs, bs, 'h', 'H', bs, bs, none, C|T }, ! 59: {K_37, 'j', 'J', nl, nl, 'j', 'J', nl, nl, none, C|T }, ! 60: {K_38, 'k', 'K', vt, vt, 'k', 'K', vt, vt, none, C|T }, ! 61: {K_39, 'l', 'L', ff, ff, 'l', 'L', ff, ff, none, C|T }, ! 62: {K_40, ';', ':', none, none, ';', ':', none, none, none, O|T }, ! 63: {K_41, '\'', '"', none, none, '\'', '"', none, none, none, O|T }, ! 64: {K_42, '\\', '|', fs, fs, '\\', '|', fs, fs, none, O|T }, ! 65: {K_43, cr, cr, nl, nl, cr, cr, nl, nl, none, O|T }, ! 66: {K_44, lshift,lshift,lshift,lshift,lshift,lshift,lshift,lshift,lshift, S|MB }, ! 67: {K_45, none, none, none, none, none, none, none, none, none, O|T }, ! 68: {K_46, 'z', 'Z', sub, sub, 'z', 'Z', sub, sub, none, C|T }, ! 69: {K_47, 'x', 'X', can, can, 'x', 'X', can, can, none, C|T }, ! 70: {K_48, 'c', 'C', etx, etx, 'c', 'C', etx, etx, none, C|T }, ! 71: {K_49, 'v', 'V', syn, syn, 'v', 'V', syn, syn, none, C|T }, ! 72: {K_50, 'b', 'B', stx, stx, 'b', 'B', stx, stx, none, C|T }, ! 73: {K_51, 'n', 'N', so, so, 'n', 'N', so, so, none, C|T }, ! 74: {K_52, 'm', 'M', cr, cr, 'm', 'M', cr, cr, none, C|T }, ! 75: {K_53, ',', '<', none, none, ',', '<', none, none, none, O|T }, ! 76: {K_54, '.', '>', none, none, '.', '>', none, none, none, O|T }, ! 77: {K_55, '/', '?', none, none, '/', '?', none, none, none, O|T }, ! 78: /* key 56 undefined */ ! 79: {K_57, rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift, S|MB }, ! 80: {K_58, lctrl, lctrl, lctrl, lctrl, lctrl, lctrl, lctrl, lctrl, lctrl, S|MB }, ! 81: /* key 59 undefined */ ! 82: {K_60, lalt, lalt, lalt, lalt, lalt, lalt, lalt, lalt, lalt, S|MB }, ! 83: {K_61, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', none, O|T }, ! 84: {K_62, ralt, ralt, ralt, ralt, ralt, ralt, ralt, ralt, ralt, S|MB }, ! 85: /* key 63 undefined */ ! 86: {K_64, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, S|MB }, ! 87: /* keys 65 through 74 undefined */ ! 88: {K_75, f40, f40, f40, f40, f40, f40, f40, f40, f40, F|M }, ! 89: {K_76, f41, f41, f41, f41, f41, f41, reboot,f41, f41, F|M }, ! 90: /* keys 77 and 78 undefined */ ! 91: {K_79, f34, f34, f34, f34, f34, f34, f34, f34, f34, F|T }, ! 92: {K_80, f37, f37, f37, f37, f37, f37, f37, f37, f37, F|M }, ! 93: {K_81, f31, f31, f31, f31, f31, f31, f31, f31, f31, F|M }, ! 94: /* key 82 undefined */ ! 95: {K_83, f38, f38, f38, f38, f38, f38, f38, f38, f38, F|T }, ! 96: {K_84, f32, f32, f32, f32, f32, f32, f32, f32, f32, F|T }, ! 97: {K_85, f39, f39, f39, f39, f39, f39, f39, f39, f39, F|M }, ! 98: {K_86, f33, f33, f33, f33, f33, f33, f33, f33, f33, F|M }, ! 99: /* keys 87 and 88 undefined */ ! 100: {K_89, f36, f36, f36, f36, f36, f36, f36, f36, f36, F|T }, ! 101: {K_90, num, num, num, num, num, num, num, num, num, S|M }, ! 102: {K_91, f37, f57, f57, f57, f57, f57, f57, f57, f57, F|N|M}, ! 103: {K_92, f34, f54, f54, f54, f54, f54, f54, f54, f54, F|N|M}, ! 104: {K_93, f31, f51, f51, f51, f51, f51, f51, f51, f51, F|N|M}, ! 105: /* key 94 undefined */ ! 106: {K_95, '/', '/', none, none, none, none, none, none, none, O|M }, ! 107: {K_96, f38, f58, f58, f58, f58, f58, f58, f58, f58, F|N|M}, ! 108: {K_97, f35, f55, f55, f55, f55, f55, f55, f55, f55, F|N|M}, ! 109: {K_98, f32, f52, f52, f52, f52, f52, f52, f52, f52, F|N|M}, ! 110: {K_99, f40, f60, f60, f60, f60, f60, f60, f60, f60, F|N|M}, ! 111: {K_100, '*', '*', none, none, none, none, none, none, none, O|M }, ! 112: {K_101, f39, f59, f59, f59, f59, f59, f59, f59, f59, F|N|M}, ! 113: {K_102, f36, f56, f56, f56, f56, f56, f56, f56, f56, F|N|M}, ! 114: {K_103, f33, f53, f53, f53, f53, f53, f53, f53, f53, F|N|M}, ! 115: {K_104, f41, f61, f61, f61, f61, f61, reboot,f61, f61, F|N|M}, ! 116: {K_105, '-', '-', none, none, none, none, none, none, none, O|M }, ! 117: {K_106, '+', '+', none, none, none, none, none, none, none, O|M }, ! 118: /* key 107 undefined */ ! 119: {K_108, cr, cr, nl, nl, cr, cr, nl, nl, none, O|M }, ! 120: /* key 109 undefined */ ! 121: {K_110, esc, esc, none, none, esc, esc, none, none, none, O|M }, ! 122: /* key 111 undefined */ ! 123: {K_112, f1, f11, f11, f11, f11, f11, f11, f11, f11, F|M }, ! 124: {K_113, f2, f12, f12, f12, f12, f12, f12, f12, f12, F|M }, ! 125: {K_114, f3, f13, f13, f13, f13, f13, f13, f13, f13, F|M }, ! 126: {K_115, f4, f14, f14, f14, f14, f14, f14, f14, f14, F|M }, ! 127: {K_116, f5, f15, f15, f15, f15, f15, f15, f15, f15, F|M }, ! 128: {K_117, f6, f16, f16, f16, f16, f16, f16, f16, f16, F|M }, ! 129: {K_118, f7, f17, f17, f17, f17, f17, f17, f17, f17, F|M }, ! 130: {K_119, f8, f18, f18, f18, f18, f18, f18, f18, f18, F|M }, ! 131: {K_120, f9, f19, f19, f19, f19, f19, f19, f19, f19, F|M }, ! 132: {K_121, f10, f20, f20, f20, f20, f20, f20, f20, f20, F|M }, ! 133: {K_122, none, none, none, none, none, none, none, none, none, O|M }, ! 134: {K_123, none, none, none, none, none, none, none, none, none, O|M }, ! 135: {K_124, none, none, none, none, none, none, none, none, none, O|M }, ! 136: {K_125, scroll,scroll,scroll,scroll,scroll,scroll,scroll,scroll,scroll, S|M }, ! 137: {K_126, none, none, none, none, none, none, none, none, none, O|M } ! 138: }; ! 139: ! 140: /* ! 141: * Special and programable function key definitions: ! 142: * ! 143: * Notes: ! 144: * 1) If a key outputs a multi-byte sequence in any mode, the key ! 145: * must be defined as a function key (flags field == F) and all entries ! 146: * for the key must be function keys (i.e., f1 through f50). ! 147: * ! 148: * 2) All key definition strings must be terminated by a \377 sequence. ! 149: * This allows the NUL ('\0') character to be embedded in function strings. ! 150: */ ! 151: ! 152: unsigned char *funkey[] = { ! 153: /* 0/reboot */ "reboot\377", /* jump to reboot code */ ! 154: /* 1 */ "\033[1x\377", /* F1 */ ! 155: /* 2 */ "\033[2x\377", /* F2 */ ! 156: /* 3 */ "\033[3x\377", /* F3 */ ! 157: /* 4 */ "\033[4x\377", /* F4 */ ! 158: /* 5 */ "\033[5x\377", /* F5 */ ! 159: /* 6 */ "\033[6x\377", /* F6 */ ! 160: /* 7 */ "\033[7x\377", /* F7 */ ! 161: /* 8 */ "\033[8x\377", /* F8 */ ! 162: /* 9 */ "\033[9x\377", /* F9 */ ! 163: /* 10 */ "\033[0x\377", /* F10 - historical value */ ! 164: /* 11 */ "\033[1y\377", /* F11 */ ! 165: /* 12 */ "\033[2y\377", /* F12 */ ! 166: /* 13 */ "\033[3y\377", /* F13 */ ! 167: /* 14 */ "\033[4y\377", /* F14 */ ! 168: /* 15 */ "\033[5y\377", /* F15 */ ! 169: /* 16 */ "\033[6y\377", /* F16 */ ! 170: /* 17 */ "\033[7y\377", /* F17 */ ! 171: /* 18 */ "\033[8y\377", /* F18 */ ! 172: /* 19 */ "\033[9y\377", /* F19 */ ! 173: /* 20 */ "\033[0y\377", /* F20 */ ! 174: /* 21 */ "F21\377", /* unused */ ! 175: /* 22 */ "F22\377", /* unused */ ! 176: /* 23 */ "F23\377", /* unused */ ! 177: /* 24 */ "F24\377", /* unused */ ! 178: /* 25 */ "F25\377", /* unused */ ! 179: /* 26 */ "F26\377", /* unused */ ! 180: /* 27 */ "F27\377", /* unused */ ! 181: /* 28 */ "F28\377", /* unused */ ! 182: /* 29 */ "F29\377", /* unused */ ! 183: /* 30 */ "F30\377", /* unused */ ! 184: /* 31 */ "\033[24H\377", /* End */ ! 185: /* 32 */ "\033[B\377", /* Down Arrow */ ! 186: /* 33 */ "\033[U\377", /* Page Down */ ! 187: /* 34 */ "\033[D\377", /* Left Arrow */ ! 188: /* 35 */ "\377", /* Unshifted keypad 5 */ ! 189: /* 36 */ "\033[C\377", /* Right Arrow */ ! 190: /* 37 */ "\033[H\377", /* Home */ ! 191: /* 38 */ "\033[A\377", /* Up Arrow */ ! 192: /* 39 */ "\033[V\377", /* Page Up */ ! 193: /* 40 */ "\033[@\377", /* Insert */ ! 194: /* 41 */ "\033[P\377", /* Delete */ ! 195: /* 42 */ "\t\377", /* Tab */ ! 196: /* 43 */ "\033[Z\377", /* Back Tab */ ! 197: /* 44 */ "F44\377", /* unused */ ! 198: /* 45 */ "F45\377", /* unused */ ! 199: /* 46 */ "F46\377", /* unused */ ! 200: /* 47 */ "F47\377", /* unused */ ! 201: /* 48 */ "F48\377", /* unused */ ! 202: /* 49 */ "F49\377", /* unused */ ! 203: /* 50 */ "F50\377", /* unused */ ! 204: /* 51 */ "1\377", /* Keypad 1 */ ! 205: /* 52 */ "2\377", /* Keypad 2 */ ! 206: /* 53 */ "3\377", /* Keypad 3 */ ! 207: /* 54 */ "4\377", /* Keypad 4 */ ! 208: /* 55 */ "5\377", /* Keypad 5 */ ! 209: /* 56 */ "6\377", /* Keypad 6 */ ! 210: /* 57 */ "7\377", /* Keypad 7 */ ! 211: /* 58 */ "8\377", /* Keypad 8 */ ! 212: /* 59 */ "9\377", /* Keypad 9 */ ! 213: /* 60 */ "0\377", /* Keypad 0 */ ! 214: /* 61 */ ".\377" /* Keypad . */ ! 215: }; ! 216: ! 217: int numfun = sizeof(funkey) / sizeof(funkey[0]); /* # of Fn keys */ ! 218: int numkey = sizeof(kbtbl) / sizeof(kbtbl[0]); /* # of actual keys */ ! 219: /* end of us.c */ ! 220:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.