Annotation of coherent/b/kernel/tools/usswan.c, revision 1.1

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.