Subversion Repositories HelenOS

Rev

Rev 2071 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (c) 2006 Jakub Jermar
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * - Redistributions of source code must retain the above copyright
  10.  *   notice, this list of conditions and the following disclaimer.
  11.  * - Redistributions in binary form must reproduce the above copyright
  12.  *   notice, this list of conditions and the following disclaimer in the
  13.  *   documentation and/or other materials provided with the distribution.
  14.  * - The name of the author may not be used to endorse or promote products
  15.  *   derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  */
  28.  
  29. /** @addtogroup genarch
  30.  * @{
  31.  */
  32. /**
  33.  * @file
  34.  * @brief   Scan codes for Sun keyboards.
  35.  */
  36.  
  37. #include <genarch/scanc.h>
  38.  
  39. /** Primary meaning of scancodes. */
  40. int sc_primary_map[] = {
  41.     [0x00] = SPECIAL,
  42.     [0x01] = SPECIAL,
  43.     [0x02] = SPECIAL,
  44.     [0x03] = SPECIAL,
  45.     [0x04] = SPECIAL,
  46.     [0x05] = FUNCTION_KEYS + 1, /* F1 */
  47.     [0x06] = FUNCTION_KEYS + 2, /* F2 */
  48.     [0x07] = FUNCTION_KEYS + 10,    /* F10 */
  49.     [0x08] = FUNCTION_KEYS + 3, /* F3 */
  50.     [0x09] = FUNCTION_KEYS + 11,    /* F11 */
  51.     [0x0a] = FUNCTION_KEYS + 4, /* F4 */
  52.     [0x0b] = FUNCTION_KEYS + 12,    /* F12 */
  53.     [0x0c] = FUNCTION_KEYS + 5, /* F5 */
  54.     [0x0d] = SPECIAL,   /* RAlt */
  55.     [0x0e] = FUNCTION_KEYS + 6, /* F6 */
  56.     [0x0f] = SPECIAL,
  57.     [0x10] = FUNCTION_KEYS + 7, /* F7 */
  58.     [0x11] = FUNCTION_KEYS + 8, /* F8 */
  59.     [0x12] = FUNCTION_KEYS + 9, /* F9 */
  60.     [0x13] = SPECIAL,   /* LAlt */
  61.     [0x14] = SPECIAL,   /* Up Arrow */
  62.     [0x15] = SPECIAL,   /* Pause */
  63.     [0x16] = SPECIAL,
  64.     [0x17] = SPECIAL,   /* Scroll Lock */
  65.     [0x18] = SPECIAL,   /* Left Arrow */
  66.     [0x19] = SPECIAL,
  67.     [0x1a] = SPECIAL,
  68.     [0x1b] = SPECIAL,   /* Down Arrow */
  69.     [0x1c] = SPECIAL,   /* Right Arrow */
  70.     [0x1d] = SPECIAL,   /* Esc */
  71.     [0x1e] = '1',
  72.     [0x1f] = '2',
  73.     [0x20] = '3',
  74.     [0x21] = '4',
  75.     [0x22] = '5',
  76.     [0x23] = '6',
  77.     [0x24] = '7',
  78.     [0x25] = '8',
  79.     [0x26] = '9',
  80.     [0x27] = '0',
  81.     [0x28] = '-',
  82.     [0x29] = '=',
  83.     [0x2a] = '`',
  84.     [0x2b] = '\b',      /* Backspace */
  85.     [0x2c] = SPECIAL,   /* Insert */
  86.     [0x2d] = SPECIAL,
  87.     [0x2e] = '/',       /* numeric keypad */
  88.     [0x2f] = '*',       /* numeric keypad */
  89.     [0x30] = SPECIAL,
  90.     [0x31] = SPECIAL,
  91.     [0x32] = '.',       /* numeric keypad */
  92.     [0x33] = SPECIAL,
  93.     [0x34] = SPECIAL,   /* Home */
  94.     [0x35] = '\t',      /* Tab */
  95.     [0x36] = 'q',
  96.     [0x37] = 'w',
  97.     [0x38] = 'e',
  98.     [0x39] = 'r',
  99.     [0x3a] = 't',
  100.     [0x3b] = 'y',
  101.     [0x3c] = 'u',
  102.     [0x3d] = 'i',
  103.     [0x3e] = 'o',
  104.     [0x3f] = 'p',
  105.     [0x40] = '[',
  106.     [0x41] = ']',
  107.     [0x42] = SPECIAL,   /* Del */
  108.     [0x43] = SPECIAL,
  109.     [0x44] = '7',       /* numeric keypad */
  110.     [0x45] = '8',       /* numeric keypad */
  111.     [0x46] = '9',       /* numeric keypad */
  112.     [0x47] = '-',       /* numeric keypad */
  113.     [0x48] = SPECIAL,
  114.     [0x49] = SPECIAL,
  115.     [0x4a] = SPECIAL,   /* End */
  116.     [0x4b] = SPECIAL,
  117.     [0x4c] = SPECIAL,   /* Control */
  118.     [0x4d] = 'a',
  119.     [0x4e] = 's',
  120.     [0x4f] = 'd',
  121.     [0x50] = 'f',
  122.     [0x51] = 'g',
  123.     [0x52] = 'h',
  124.     [0x53] = 'j',
  125.     [0x54] = 'k',
  126.     [0x55] = 'l',
  127.     [0x56] = ';',
  128.     [0x57] = '\'',
  129.     [0x58] = '\\',
  130.     [0x59] = '\n',      /* Enter */
  131.     [0x5a] = '\n',      /* Enter on numeric keypad */
  132.     [0x5b] = '4',       /* numeric keypad */
  133.     [0x5c] = '5',       /* numeric keypad */
  134.     [0x5d] = '6',       /* numeric keypad */
  135.     [0x5e] = '0',       /* numeric keypad */
  136.     [0x5f] = SPECIAL,
  137.     [0x60] = SPECIAL,   /* Page Up */
  138.     [0x61] = SPECIAL,
  139.     [0x62] = SPECIAL,   /* Num Lock */
  140.     [0x63] = SPECIAL,   /* LShift */
  141.     [0x64] = 'z',
  142.     [0x65] = 'x',
  143.     [0x66] = 'c',
  144.     [0x67] = 'v',
  145.     [0x68] = 'b',
  146.     [0x69] = 'n',
  147.     [0x6a] = 'm',
  148.     [0x6b] = ',',
  149.     [0x6c] = '.',
  150.     [0x6d] = '/',
  151.     [0x6e] = SPECIAL,   /* RShift */
  152.     [0x6f] = SPECIAL,
  153.     [0x70] = '1',       /* numeric keypad */
  154.     [0x71] = '2',       /* numeric keypad */
  155.     [0x72] = '3',       /* numeric keypad */
  156.     [0x73] = SPECIAL,
  157.     [0x74] = SPECIAL,
  158.     [0x75] = SPECIAL,
  159.     [0x76] = SPECIAL,
  160.     [0x77] = SPECIAL,   /* Caps Lock */
  161.     [0x78] = SPECIAL,
  162.     [0x79] = ' ',
  163.     [0x7a] = SPECIAL,
  164.     [0x7b] = SPECIAL,   /* Page Down */
  165.     [0x7c] = SPECIAL,
  166.     [0x7d] = '+',       /* numeric key pad */
  167.     [0x7e] = SPECIAL,
  168.     [0x7f] = SPECIAL
  169. };
  170.  
  171. /** Secondary meaning of scancodes. */
  172. int sc_secondary_map[] = {
  173.     [0x00] = SPECIAL,
  174.     [0x01] = SPECIAL,
  175.     [0x02] = SPECIAL,
  176.     [0x03] = SPECIAL,
  177.     [0x04] = SPECIAL,
  178.     [0x05] = SPECIAL,   /* F1 */
  179.     [0x06] = SPECIAL,   /* F2 */
  180.     [0x07] = SPECIAL,   /* F10 */
  181.     [0x08] = SPECIAL,   /* F3 */
  182.     [0x09] = SPECIAL,   /* F11 */
  183.     [0x0a] = SPECIAL,   /* F4 */
  184.     [0x0b] = SPECIAL,   /* F12 */
  185.     [0x0c] = SPECIAL,   /* F5 */
  186.     [0x0d] = SPECIAL,   /* RAlt */
  187.     [0x0e] = SPECIAL,   /* F6 */
  188.     [0x0f] = SPECIAL,
  189.     [0x10] = SPECIAL,   /* F7 */
  190.     [0x11] = SPECIAL,   /* F8 */
  191.     [0x12] = SPECIAL,   /* F9 */
  192.     [0x13] = SPECIAL,   /* LAlt */
  193.     [0x14] = SPECIAL,   /* Up Arrow */
  194.     [0x15] = SPECIAL,   /* Pause */
  195.     [0x16] = SPECIAL,
  196.     [0x17] = SPECIAL,   /* Scroll Lock */
  197.     [0x18] = SPECIAL,   /* Left Arrow */
  198.     [0x19] = SPECIAL,
  199.     [0x1a] = SPECIAL,
  200.     [0x1b] = SPECIAL,   /* Down Arrow */
  201.     [0x1c] = SPECIAL,   /* Right Arrow */
  202.     [0x1d] = SPECIAL,   /* Esc */
  203.     [0x1e] = '!',
  204.     [0x1f] = '@',
  205.     [0x20] = '#',
  206.     [0x21] = '$',
  207.     [0x22] = '%',
  208.     [0x23] = '^',
  209.     [0x24] = '&',
  210.     [0x25] = '*',
  211.     [0x26] = '(',
  212.     [0x27] = ')',
  213.     [0x28] = '_',
  214.     [0x29] = '+',
  215.     [0x2a] = '~',
  216.     [0x2b] = SPECIAL,   /* Backspace */
  217.     [0x2c] = SPECIAL,   /* Insert */
  218.     [0x2d] = SPECIAL,
  219.     [0x2e] = '/',       /* numeric keypad */
  220.     [0x2f] = '*',       /* numeric keypad */
  221.     [0x30] = SPECIAL,
  222.     [0x31] = SPECIAL,
  223.     [0x32] = '.',       /* numeric keypad */
  224.     [0x33] = SPECIAL,
  225.     [0x34] = SPECIAL,   /* Home */
  226.     [0x35] = SPECIAL,   /* Tab */
  227.     [0x36] = 'Q',
  228.     [0x37] = 'W',
  229.     [0x38] = 'E',
  230.     [0x39] = 'R',
  231.     [0x3a] = 'T',
  232.     [0x3b] = 'Y',
  233.     [0x3c] = 'U',
  234.     [0x3d] = 'I',
  235.     [0x3e] = 'O',
  236.     [0x3f] = 'P',
  237.     [0x40] = '{',
  238.     [0x41] = '}',
  239.     [0x42] = SPECIAL,   /* Del */
  240.     [0x43] = SPECIAL,
  241.     [0x44] = '7',       /* numeric keypad */
  242.     [0x45] = '8',       /* numeric keypad */
  243.     [0x46] = '9',       /* numeric keypad */
  244.     [0x47] = '-',       /* numeric keypad */
  245.     [0x48] = SPECIAL,
  246.     [0x49] = SPECIAL,
  247.     [0x4a] = SPECIAL,   /* End */
  248.     [0x4b] = SPECIAL,
  249.     [0x4c] = SPECIAL,   /* Control */
  250.     [0x4d] = 'A',
  251.     [0x4e] = 'S',
  252.     [0x4f] = 'D',
  253.     [0x50] = 'F',
  254.     [0x51] = 'G',
  255.     [0x52] = 'H',
  256.     [0x53] = 'J',
  257.     [0x54] = 'K',
  258.     [0x55] = 'L',
  259.     [0x56] = ':',
  260.     [0x57] = '"',
  261.     [0x58] = '|',
  262.     [0x59] = SPECIAL,   /* Enter */
  263.     [0x5a] = SPECIAL,   /* Enter on numeric keypad */
  264.     [0x5b] = '4',       /* numeric keypad */
  265.     [0x5c] = '5',       /* numeric keypad */
  266.     [0x5d] = '6',       /* numeric keypad */
  267.     [0x5e] = '0',       /* numeric keypad */
  268.     [0x5f] = SPECIAL,
  269.     [0x60] = SPECIAL,   /* Page Up */
  270.     [0x61] = SPECIAL,
  271.     [0x62] = SPECIAL,   /* Num Lock */
  272.     [0x63] = SPECIAL,   /* LShift */
  273.     [0x64] = 'Z',
  274.     [0x65] = 'X',
  275.     [0x66] = 'C',
  276.     [0x67] = 'V',
  277.     [0x68] = 'B',
  278.     [0x69] = 'N',
  279.     [0x6a] = 'M',
  280.     [0x6b] = '<',
  281.     [0x6c] = '>',
  282.     [0x6d] = '?',
  283.     [0x6e] = SPECIAL,   /* RShift */
  284.     [0x6f] = SPECIAL,
  285.     [0x70] = '1',       /* numeric keypad */
  286.     [0x71] = '2',       /* numeric keypad */
  287.     [0x72] = '3',       /* numeric keypad */
  288.     [0x73] = SPECIAL,
  289.     [0x74] = SPECIAL,
  290.     [0x75] = SPECIAL,
  291.     [0x76] = SPECIAL,
  292.     [0x77] = SPECIAL,   /* Caps Lock */
  293.     [0x78] = SPECIAL,
  294.     [0x79] = ' ',
  295.     [0x7a] = SPECIAL,
  296.     [0x7b] = SPECIAL,   /* Page Down */
  297.     [0x7c] = SPECIAL,
  298.     [0x7d] = '+',       /* numeric key pad */
  299.     [0x7e] = SPECIAL,
  300.     [0x7f] = SPECIAL
  301. };
  302.  
  303. /** @}
  304.  */
  305.