Home | History | Annotate | Line # | Download | only in maple
mkbdmap.h revision 1.2
      1 /*	$NetBSD: mkbdmap.h,v 1.2 2001/01/16 00:56:29 marcus Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2001 Marcus Comstedt
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by the NetBSD
     18  *	Foundation, Inc. and its contributors.
     19  * 4. Neither the name of The NetBSD Foundation nor the names of its
     20  *    contributors may be used to endorse or promote products derived
     21  *    from this software without specific prior written permission.
     22  *
     23  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     24  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     25  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     26  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     27  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33  * POSSIBILITY OF SUCH DAMAGE.
     34  */
     35 
     36 #define KC(n) KS_KEYCODE(n)
     37 
     38 static const keysym_t mkbd_keydesc_jp[] = {
     39 /*  pos		normal		shifted */
     40     KC(4),	KS_a,
     41     KC(5),	KS_b,
     42     KC(6),	KS_c,
     43     KC(7),	KS_d,
     44     KC(8),	KS_e,
     45     KC(9),	KS_f,
     46     KC(10),	KS_g,
     47     KC(11),	KS_h,
     48     KC(12),	KS_i,
     49     KC(13),	KS_j,
     50     KC(14),	KS_k,
     51     KC(15),	KS_l,
     52     KC(16),	KS_m,
     53     KC(17),	KS_n,
     54     KC(18),	KS_o,
     55     KC(19),	KS_p,
     56     KC(20),	KS_q,
     57     KC(21),	KS_r,
     58     KC(22),	KS_s,
     59     KC(23),	KS_t,
     60     KC(24),	KS_u,
     61     KC(25),	KS_v,
     62     KC(26),	KS_w,
     63     KC(27),	KS_x,
     64     KC(28),	KS_y,
     65     KC(29),	KS_z,
     66 
     67     KC(30),	KS_1,		KS_exclam,
     68     KC(31),	KS_2,		KS_quotedbl,
     69     KC(32),	KS_3,		KS_numbersign,
     70     KC(33),	KS_4,		KS_dollar,
     71     KC(34),	KS_5,		KS_percent,
     72     KC(35),	KS_6,		KS_ampersand,
     73     KC(36),	KS_7,		KS_apostrophe,
     74     KC(37),	KS_8,		KS_parenleft,
     75     KC(38),	KS_9,		KS_parenright,
     76     KC(39),	KS_0,		KS_asciitilde,
     77 
     78     KC(40),	KS_Return,
     79     KC(41),	KS_Escape,
     80     KC(42),	KS_BackSpace,
     81     KC(43),	KS_Tab,
     82     KC(44),	KS_space,
     83 
     84     KC(45),	KS_minus,	KS_equal,
     85     KC(46),	KS_asciicircum,	KS_macron,
     86     KC(47),	KS_at,		KS_grave,
     87     KC(48),	KS_bracketleft,	KS_braceleft,
     88     /* no 49 */
     89     KC(50),	KS_bracketright,KS_braceright,
     90     KC(51),	KS_semicolon,	KS_plus,
     91     KC(52),	KS_colon,	KS_asterisk,
     92     KC(53),	KS_Zenkaku_Hankaku,
     93     KC(54),	KS_comma,	KS_less,
     94     KC(55),	KS_period,	KS_greater,
     95     KC(56),	KS_slash,	KS_question,
     96 
     97     KC(57),	KS_Caps_Lock,
     98 
     99     KC(58),	KS_f1,
    100     KC(59),	KS_f2,
    101     KC(60),	KS_f3,
    102     KC(61),	KS_f4,
    103     KC(62),	KS_f5,
    104     KC(63),	KS_f6,
    105     KC(64),	KS_f7,
    106     KC(65),	KS_f8,
    107     KC(66),	KS_f9,
    108     KC(67),	KS_f10,
    109     KC(68),	KS_f11,
    110     KC(69),	KS_f12,
    111 
    112     KC(70),	KS_Print_Screen,
    113     KC(71),	KS_Hold_Screen,
    114     KC(72),	KS_Pause,
    115     KC(73),	KS_Insert,
    116     KC(74),	KS_Home,
    117     KC(75),	KS_Prior,
    118     KC(76),	KS_Delete,
    119     KC(77),	KS_End,
    120     KC(78),	KS_Next,
    121     KC(79),	KS_Right,
    122     KC(80),	KS_Left,
    123     KC(81),	KS_Down,
    124     KC(82),	KS_Up,
    125 
    126     /* 83-99 is numeric keypad */
    127 
    128     /* 100 is european keyboard only */
    129 
    130     KC(101),	KS_Help,
    131 
    132     /* no 102-134 */
    133 
    134     KC(135),	KS_backslash,	KS_underscore,
    135     KC(136),	KS_Hiragana_Katakana,
    136     KC(137),	KS_yen,		KS_bar,
    137     KC(138),	KS_Henkan_Mode,
    138     KC(139),	KS_Muhenkan,
    139 
    140     KC(0x100),	KS_Control_L,
    141     KC(0x101),	KS_Shift_L,
    142     KC(0x102),	KS_Alt_L,
    143     KC(0x103),	KS_Meta_L,
    144     KC(0x104),	KS_Control_R,
    145     KC(0x105),	KS_Shift_R,
    146     KC(0x106),	KS_Alt_R,
    147     KC(0x107),	KS_Meta_R,
    148 };
    149 
    150 
    151 static const keysym_t mkbd_keydesc_uk[] = {
    152 /*  pos		normal		shifted */
    153 
    154     KC(32),	KS_3,		KS_sterling,
    155 
    156     KC(35),	KS_6,		KS_asciicircum,
    157     KC(36),	KS_7,		KS_ampersand,
    158     KC(37),	KS_8,		KS_asterisk,
    159     KC(38),	KS_9,		KS_parenleft,
    160     KC(39),	KS_0,		KS_parenright,
    161 
    162     KC(45),	KS_minus,	KS_underscore,
    163     KC(46),	KS_equal,	KS_plus,
    164     KC(47),	KS_bracketleft,	KS_braceleft,
    165     KC(48),	KS_bracketright,KS_braceright,
    166 
    167     KC(50),	KS_numbersign,	KS_asciitilde,
    168     KC(51),	KS_semicolon,	KS_colon,
    169     KC(52),	KS_apostrophe,	KS_at,
    170     KC(53),	KS_grave,	KS_notsign,	KS_brokenbar,
    171 
    172     KC(83),	KS_Num_Lock,
    173     KC(84),	KS_KP_Divide,
    174     KC(85),	KS_KP_Multiply,
    175     KC(86),	KS_KP_Subtract,
    176     KC(87),	KS_KP_Add,
    177     KC(88),	KS_KP_Enter,
    178     KC(89),	KS_KP_1,
    179     KC(90),	KS_KP_2,
    180     KC(91),	KS_KP_3,
    181     KC(92),	KS_KP_4,
    182     KC(93),	KS_KP_5,
    183     KC(94),	KS_KP_6,
    184     KC(95),	KS_KP_7,
    185     KC(96),	KS_KP_8,
    186     KC(97),	KS_KP_9,
    187     KC(98),	KS_KP_0,
    188     KC(99),	KS_KP_Decimal,
    189 
    190     KC(100),	KS_backslash,	KS_bar,
    191 };
    192 
    193 #define KBD_MAP(name, base, map) \
    194 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
    195 
    196 static const struct wscons_keydesc mkbd_keydesctab[] = {
    197 	KBD_MAP(KB_JP,			0,	mkbd_keydesc_jp),
    198 	KBD_MAP(KB_UK,		    KB_JP,	mkbd_keydesc_uk),
    199 	{0, 0, 0, 0}
    200 };
    201 
    202 #undef KBD_MAP
    203 #undef KC
    204