home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / bsd / dev / i386 / keycodes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-30  |  4.6 KB  |  134 lines

  1. /*     Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * keycodes.h
  4.  *
  5.  * HISTORY
  6.  * 21 Oct 92    Joe Pasqua
  7.  *      Created based on previous versions.
  8.  */
  9.  
  10. #ifndef    _KEYCODES_
  11. #define    _KEYCODES_
  12.  
  13. #define    nul    0x000
  14. #define    soh    0x001
  15. #define    stx    0x002
  16. #define    etx    0x003
  17. #define    eot    0x004
  18. #define    enq    0x005
  19. #define    ack    0x006
  20. #define    bel    0x007
  21. #define    bs    0x008
  22. #define    ht    0x009
  23. #define    nl    0x00a
  24. #define    vt    0x00b
  25. #define    np    0x00c
  26. #define    cr    0x00d
  27. #define    so    0x00e
  28. #define    si    0x00f
  29. #define    dle    0x010
  30. #define    dc1    0x011
  31. #define    dc2    0x012
  32. #define    dc3    0x013
  33. #define    dc4    0x014
  34. #define    nak    0x015
  35. #define    syn    0x016
  36. #define    etb    0x017
  37. #define    can    0x018
  38. #define    em    0x019
  39. #define    sub    0x01a
  40. #define    esc    0x01b
  41. #define    fs    0x01c
  42. #define    gs    0x01d
  43. #define    rs    0x01e
  44. #define    us    0x01f
  45. #define    del    0x07f
  46. #define    inv    0x100        /* invalid key code */
  47. #define    dim    0x101
  48. #define    quiet    0x102
  49. #define    left    0x103
  50. #define    down    0x104
  51. #define    right    0x105
  52. #define    up    0x106
  53. #define    bright    0x107
  54. #define    loud    0x108
  55. #define    mouse_l    0x109
  56. #define    ret    '\r'
  57. #define    tab    '\t'
  58.  
  59. // The following table maps scancodes from the PC keyboard into ascii
  60. // characters. Each two entries in the table represent a single character.
  61. // The first value is used whn the shift key is NOT pressed. The second
  62. // value is used wheh the shift key IS preseed. This consumes the first
  63. // _N_KEYCODES * 2 entries in the table. After that, there are another
  64. // _N_KEYCODES * 2 entries that represent the ascii to use for the given
  65. // keycode when the control key is pressed.
  66.  
  67. #define    _N_KEYCODES    0x6E
  68. u_short ascii[_N_KEYCODES * 4] = {
  69.     // The following entries represent the non-control keys and their
  70.     // shift values (in that order). Each pair of entries represents 1 key.
  71.     inv, inv,    esc, esc,    '1', '!',    '2', '@',  // 00-03
  72.     '3', '#',    '4', '$',    '5', '%',    '6', '^',  // 04-07
  73.     '7', '&',    '8', '*',    '9', '(',    '0', ')',  // 08-0B
  74.     '-', '_',    '=', '+',    del, bs,    tab, tab,  // 0C-0F
  75.     'q', 'Q',    'w', 'W',    'e', 'E',    'r', 'R',  // 10-13
  76.     't', 'T',    'y', 'Y',    'u', 'U',    'i', 'I',  // 14-17
  77.     'o', 'O',    'p', 'P',    '[', '{',    ']', '}',  // 18-1B
  78.     ret, ret,    inv, inv,    'a', 'A',     's', 'S',  // 1C-1F
  79.     'd', 'D',    'f', 'F',    'g', 'G',    'h', 'H',  // 20-23
  80.     'j', 'J',    'k', 'K',    'l', 'L',    ';', ':',  // 24-27
  81.     '\'', '"',    '`', '~',    inv, inv,    '\\', '|', // 28-2B
  82.     'z', 'Z',    'x', 'X',    'c', 'C',    'v', 'V',  // 2C-2F
  83.     'b', 'B',    'n', 'N',    'm', 'M',    ',', '<',  // 30-33
  84.     '.', '>',    '/', '?',    inv, inv,    '*', '*',  // 34-37
  85.     inv, inv,    ' ', ' ',    inv, inv,    inv, inv,  // 38-3B
  86.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 3C-3F
  87.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 40-43
  88.     inv, inv,    '`', '~',    inv, inv,    '7', '7',  // 44-47
  89.     '8', '8',    '9', '9',    '-', '-',    '4', '4',  // 48-4B
  90.     '5', '5',    '6', '6',    '+', '+',    '1', '1',  // 4C-4F
  91.     '2', '2',    '3', '3',    '0', '0',    '.', '.',  // 50-53
  92.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 54-57
  93.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 58-5B
  94.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 5C-5F
  95.     inv, inv,    inv, inv,    ret, ret,    '/', '/',  // 60-63
  96.     up, up,        down, down,    left, left,    right, right, // 64-67
  97.     loud, loud,    quiet, quiet,    bright, bright,    dim, dim,  // 68-6B
  98.     inv, inv,    inv, inv,                   // 6C-6D
  99.     
  100.     // The following entries represent the control and control-shift
  101.     // keys (in that order). Each pair of entries represents 1 key.
  102.     inv, inv,    esc, esc,    '1', '!',    nul, nul,  // 00-03
  103.     '3', '#',    '4', '$',    '5', '%',    rs, rs,    // 04-07
  104.     '7', '&',    '8', '*',    '9', '(',    '0', ')',  // 08-0B
  105.     us, us,     '=', '+',    inv, inv,    tab, tab,  // 0C-0F
  106.     dc1, dc1,    etb, etb,    enq, enq,    dc2, dc2,  // 10-13
  107.     dc4, dc4,    em, em,     nak, nak,    ht, ht,    // 14-17
  108.     si, si,     dle, dle,    esc, esc,    fs, fs,    // 18-1B
  109.     ret, ret,    inv, inv,    soh, soh,     dc3, dc3,  // 1C-1F
  110.     eot, eot,    ack, ack,    bel, bel,    bs, bs,    // 20-23
  111.     nl, nl,     vt, vt,     np, np,     ';', ':',  // 24-27
  112.     '\'', '"',    '`', '~',    inv, inv,    fs, fs,    // 28-2B
  113.     sub, sub,    can, can,    etx, etx,    syn, syn,  // 2C-2F
  114.     stx, stx,    so, so,     cr, cr,     ',', '<',  // 30-33
  115.     '.', '>',    '/', '?',    inv, inv,    '*', '*',  // 34-37
  116.     inv, inv,    nul, nul,    inv, inv,    inv, inv,  // 38-3B
  117.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 3C-3F
  118.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 40-43
  119.     inv, inv,    '`', '~',    inv, inv,    '7', '7',  // 44-47
  120.     '8', '8',    '9', '9',    '-', '-',    '4', '4',  // 48-4B
  121.     '5', '5',    '6', '6',    '+', '+',    '1', '1',  // 4C-4F
  122.     '2', '2',    '3', '3',    '0', '0',    '.', '.',  // 50-53
  123.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 54-57
  124.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 58-5B
  125.     inv, inv,    inv, inv,    inv, inv,    inv, inv,  // 5C-5F
  126.     inv, inv,    inv, inv,    ret, ret,    '/', fs,   // 60-63
  127.     up, up,        down, down,    left, left,    right, right, // 64-67
  128.     loud, loud,    quiet, quiet,    bright, bright,    dim, dim,  // 68-6B
  129.     inv, inv,    inv, inv                   // 6C-6D
  130. };
  131.  
  132. #endif    _KEYCODES_
  133.  
  134.