linux_keymap.c revision 1.1 1 /* $NetBSD: linux_keymap.c,v 1.1 2017/08/30 00:39:27 jmcneill Exp $ */
2
3 /*-
4 * Copyright (c) 1997-2017 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Juergen Hannken-Illjes and Jared McNeill.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: linux_keymap.c,v 1.1 2017/08/30 00:39:27 jmcneill Exp $");
34
35 #include <sys/types.h>
36 #include <dev/wscons/wsksymdef.h>
37 #include <dev/wscons/wsksymvar.h>
38 #include <dev/wscons/linux_keymap.h>
39
40 #define KC(n) KS_KEYCODE(n)
41
42 static const keysym_t linux_keymap_keydesc_us[] = {
43 /* pos command normal shifted */
44 KC(1), KS_Cmd_Debugger, KS_Escape,
45 KC(2), KS_1, KS_exclam,
46 KC(3), KS_2, KS_at,
47 KC(4), KS_3, KS_numbersign,
48 KC(5), KS_4, KS_dollar,
49 KC(6), KS_5, KS_percent,
50 KC(7), KS_6, KS_asciicircum,
51 KC(8), KS_7, KS_ampersand,
52 KC(9), KS_8, KS_asterisk,
53 KC(10), KS_9, KS_parenleft,
54 KC(11), KS_0, KS_parenright,
55 KC(12), KS_minus, KS_underscore,
56 KC(13), KS_equal, KS_plus,
57 KC(14), KS_Cmd_ResetEmul, KS_Delete,
58 KC(15), KS_Tab,
59 KC(16), KS_q,
60 KC(17), KS_w,
61 KC(18), KS_e,
62 KC(19), KS_r,
63 KC(20), KS_t,
64 KC(21), KS_y,
65 KC(22), KS_u,
66 KC(23), KS_i,
67 KC(24), KS_o,
68 KC(25), KS_p,
69 KC(26), KS_bracketleft, KS_braceleft,
70 KC(27), KS_bracketright, KS_braceright,
71 KC(28), KS_Return,
72 KC(29), KS_Cmd1, KS_Control_L,
73 KC(30), KS_a,
74 KC(31), KS_s,
75 KC(32), KS_d,
76 KC(33), KS_f,
77 KC(34), KS_g,
78 KC(35), KS_h,
79 KC(36), KS_j,
80 KC(37), KS_k,
81 KC(38), KS_l,
82 KC(39), KS_semicolon, KS_colon,
83 KC(40), KS_apostrophe, KS_quotedbl,
84 KC(41), KS_grave, KS_asciitilde,
85 KC(42), KS_Shift_L,
86 KC(43), KS_backslash, KS_bar,
87 KC(44), KS_z,
88 KC(45), KS_x,
89 KC(46), KS_c,
90 KC(47), KS_v,
91 KC(48), KS_b,
92 KC(49), KS_n,
93 KC(50), KS_m,
94 KC(51), KS_comma, KS_less,
95 KC(52), KS_period, KS_greater,
96 KC(53), KS_slash, KS_question,
97 KC(54), KS_Shift_R,
98 KC(55), KS_KP_Multiply,
99 KC(56), KS_Cmd2, KS_Alt_L,
100 KC(57), KS_space,
101 KC(58), KS_Caps_Lock,
102 KC(59), KS_Cmd_Screen0, KS_f1,
103 KC(60), KS_Cmd_Screen1, KS_f2,
104 KC(61), KS_Cmd_Screen2, KS_f3,
105 KC(62), KS_Cmd_Screen3, KS_f4,
106 KC(63), KS_Cmd_Screen4, KS_f5,
107 KC(64), KS_Cmd_Screen5, KS_f6,
108 KC(65), KS_Cmd_Screen6, KS_f7,
109 KC(66), KS_Cmd_Screen7, KS_f8,
110 KC(67), KS_Cmd_Screen8, KS_f9,
111 KC(68), KS_Cmd_Screen9, KS_f10,
112 KC(69), KS_Num_Lock,
113 KC(70), KS_Hold_Screen,
114 KC(71), KS_KP_Home, KS_KP_7,
115 KC(72), KS_KP_Up, KS_KP_8,
116 KC(73), KS_Cmd_ScrollFastUp, KS_KP_Prior, KS_KP_9,
117 KC(74), KS_KP_Subtract,
118 KC(75), KS_KP_Left, KS_KP_4,
119 KC(76), KS_KP_Begin, KS_KP_5,
120 KC(77), KS_KP_Right, KS_KP_6,
121 KC(78), KS_KP_Add,
122 KC(79), KS_KP_End, KS_KP_1,
123 KC(80), KS_KP_Down, KS_KP_2,
124 KC(81), KS_Cmd_ScrollFastDown, KS_KP_Next, KS_KP_3,
125 KC(82), KS_KP_Insert, KS_KP_0,
126 KC(83), KS_KP_Delete, KS_KP_Decimal,
127 KC(87), KS_f11,
128 KC(88), KS_f12,
129 KC(96), KS_KP_Enter,
130 KC(97), KS_Control_R,
131 KC(98), KS_KP_Divide,
132 KC(99), KS_Print_Screen,
133 KC(100), KS_Alt_R, KS_Multi_key,
134 KC(102), KS_Home,
135 KC(103), KS_Up,
136 KC(104), KS_Cmd_ScrollFastUp, KS_Prior,
137 KC(105), KS_Left,
138 KC(106), KS_Right,
139 KC(107), KS_End,
140 KC(108), KS_Down,
141 KC(109), KS_Cmd_ScrollFastDown, KS_Next,
142 KC(110), KS_Insert,
143 KC(111), KS_Delete,
144 KC(113), KS_Cmd_VolumeToggle,
145 KC(114), KS_Cmd_VolumeDown,
146 KC(115), KS_Cmd_VolumeUp,
147 KC(119), KS_Pause, /* Break */
148 KC(125), KS_Meta_L,
149 KC(126), KS_Meta_R,
150 KC(128), KS_Stop,
151 KC(129), KS_Again,
152 KC(130), KS_Props,
153 KC(131), KS_Undo,
154 KC(132), KS_Front,
155 KC(133), KS_Copy,
156 KC(134), KS_Open,
157 KC(135), KS_Paste,
158 KC(136), KS_Find,
159 KC(137), KS_Cut,
160 KC(138), KS_Help,
161 KC(139), KS_Menu,
162 };
163
164 #define KBD_MAP(name, base, map) \
165 { name, base, sizeof(map)/sizeof(keysym_t), map }
166
167 const struct wscons_keydesc linux_keymap_keydesctab[] = {
168 KBD_MAP(KB_US, 0, linux_keymap_keydesc_us),
169
170 {0, 0, 0, 0}
171 };
172
173 #undef KBD_MAP
174 #undef KC
175