VirtualBox

source: vbox/trunk/src/VBox/Frontends/Common/VBoxKeyboard/keyboard-tables.h@ 40326

Last change on this file since 40326 was 40326, checked in by vboxsync, 13 years ago

Devices/keyboards: try to better support Sun function keys.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 12.5 KB
Line 
1/* $Id: keyboard-tables.h 40326 2012-03-02 14:55:12Z vboxsync $ */
2/** @file
3 * VBox/Frontends/Common - X11 keyboard driver translation tables.
4 */
5
6/* This code is originally from the Wine project. It was split off from
7 keyboard-new.c. (See the copyrights in that file). */
8
9/*
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25/*
26 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
27 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
28 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
29 * a choice of LGPL license versions is made available with the language indicating
30 * that LGPLv2 or any later version may be used, or where a choice of which version
31 * of the LGPL is applied is otherwise unspecified.
32 */
33
34#ifndef ___VBox_keyboard_tables_h
35# define ___VBox_keyboard_tables_h
36
37#define MAIN_LEN 50
38static const unsigned main_key_scan[MAIN_LEN] =
39{
40 /* ` 1 2 3 4 5 6 7 8 9 0 - = */
41 0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,
42 /* q w e r t y u i o p [ ] */
43 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,
44 /* a s d f g h j k l ; ' \ */
45 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B,
46 /* z x c v b n m , . / */
47 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
48 /* 102nd key Brazilian key Yen */
49 0x56, 0x73, 0x7d
50};
51
52/*** DEFINE YOUR NEW LANGUAGE-SPECIFIC MAPPINGS BELOW, SEE EXISTING TABLES */
53
54/* order: Normal, Shift */
55/* We recommend you write just what is guaranteed to be correct (i.e. what's
56 written on the keycaps), not the bunch of special characters behind AltGr
57 and Shift-AltGr if it can vary among different X servers */
58/* Remember to also add your new table to the layout index table below! */
59
60#include "keyboard-layouts.h"
61
62/*** Layout table. Add your keyboard mappings to this list */
63static const struct {
64 const char *comment;
65 const char (*key)[MAIN_LEN][2];
66} main_key_tab[]={
67#include "keyboard-list.h"
68 {NULL, NULL} /* sentinel */
69};
70
71/* Scan code table for non-character keys */
72
73static const unsigned nonchar_key_scan[256] =
74{
75 /* unused */
76 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF00 */
77 /* special keys */
78 0x0E, 0x0F, 0x00, /*?*/ 0, 0x00, 0x1C, 0x00, 0x00, /* FF08 */
79 0x00, 0x00, 0x00, 0x145, 0x46, 0x00, 0x00, 0x00, /* FF10 */
80 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* FF18 */
81 /* Sun Menu, additional Japanese keys */
82#ifdef sun
83 0x15D, 0x79, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, /* FF20 */
84 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, /* FF28 */
85#else
86 0x15D, 0x00, 0x7B, 0x79, 0x00, 0x00, 0x00, 0x70, /* FF20 */
87 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF28 */
88#endif /* sun */
89 /* additional Korean keys */
90 0x00, 0xF2, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, /* FF30 */
91 /* unused */
92 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF38 */
93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF40 */
94 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF48 */
95 /* cursor keys */
96 0x147, 0x14B, 0x148, 0x14D, 0x150, 0x149, 0x151, 0x14F, /* FF50 */
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF58 */
98 /* misc keys */
99 /* Menu */
100#ifdef sun
101 /*?*/ 0, 0x137, 0x7b, 0x152, 0x00, 0x00, 0x00, 0x15D, /* FF60 */
102#else
103 /*?*/ 0, 0x137, 0, 0x152, 0x00, 0x00, 0x00, 0x15D, /* FF60 */
104#endif /* sun */
105 /* Help (invented scan code) */
106 0x00, 0x00, 0x13B, 0x146, 0x00, 0x00, 0x00, 0x00, /* FF68 */
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF70 */
108 /* keypad keys */
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x138, 0x45, /* FF78 */
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF80 */
111 0x00, 0x00, 0x00, 0x00, 0x00, 0x11C, 0x00, 0x00, /* FF88 */
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x4B, 0x48, /* FF90 */
113 0x4D, 0x50, 0x49, 0x51, 0x4F, 0x4C, 0x52, 0x53, /* FF98 */
114 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFA0 */
115 0x00, 0x00, 0x37, 0x4E, 0x53, 0x4A, 0x7e, 0x135, /* FFA8 */
116 0x52, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D, 0x47, /* FFB0 */
117 0x48, 0x49, 0x00, 0x00, 0x00, 0x00, /* FFB8 */
118 /* function keys (F1 to F12) */
119 0x3B, 0x3C,
120 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, /* FFC0 */
121#ifdef sun
122 /* On Solaris for historical reasons the STOP and AGAIN keys are reported
123 * as F11 and F12 respectively. We send invented type 1 scan codes for
124 * which can be translated to real ones again by the USB keyboard
125 * emulation. */
126 0x13C, 0x13D, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* FFC8 */
127 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x76, 0x00, 0x00, /* FFD0 */
128#else
129 0x57, 0x58, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, /* FFC8 */
130 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x76, 0x00, 0x00, /* FFD0 */
131#endif
132 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD8 */
133 /* modifier keys */
134 0x00, 0x2A, 0x36, 0x1D, 0x11D, 0x3A, 0x00, 0x15B, /* FFE0 */
135 0x15C, 0x38, 0x138, 0x15B, 0x15C, 0x00, 0x00, 0x00, /* FFE8 */
136 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFF0 */
137 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x153 /* FFF8 */
138};
139
140/* This list was put together using /usr/include/X11/XF86keysym.h and
141 http://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html. It has not yet
142 been extensively tested. The scancodes are those used by MicroSoft
143 keyboards. */
144static const unsigned xfree86_vendor_key_scan[256] =
145{
146 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF00 */
147 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF08 */
148 /* Vol- Mute Vol+ Play Stop Track- Track+ */
149 0, 0x12e, 0x120, 0x130, 0x122, 0x124, 0x110, 0x119, /* 1008FF10 */
150 /* Home E-mail Search */
151 0x132, 0x16c, 0, 0x165, 0, 0, 0, 0, /* 1008FF18 */
152 /* Calndr PwrDown Back Forward */
153 0x115, 0x15e, 0, 0, 0, 0, 0x16a, 0x169, /* 1008FF20 */
154 /* Stop Refresh Power Wake Sleep */
155 0x168, 0x167, 0x15e, 0x163, 0, 0, 0, 0x15f, /* 1008FF28 */
156 /* Favrts Pause Media MyComp */
157 0x166, 0x122, 0x16d, 0x16b, 0, 0, 0, 0, /* 1008FF30 */
158 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF38 */
159 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF40 */
160 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF48 */
161 /* AppL AppR Calc Close Copy */
162 0x109, 0x11e, 0, 0, 0x121, 0, 0x140, 0x118, /* 1008FF50 */
163 /* Cut Docmnts Excel */
164 0x117, 0, 0, 0x105, 0x114, 0, 0, 0, /* 1008FF58 */
165 /* LogOff */
166 0, 0x116, 0, 0, 0, 0, 0, 0, /* 1008FF60 */
167 /* OffcHm Open Paste */
168 0, 0, 0x13c, 0x13f, 0, 0x10a, 0, 0, /* 1008FF68 */
169 /* Reply Refresh Save */
170 0, 0, 0x141, 0x167, 0, 0, 0, 0x157, /* 1008FF70 */
171 /* ScrlUp ScrlDn Send Spell TaskPane */
172 0x10b, 0x18b, 0, 0x143, 0x123, 0, 0, 0x13d, /* 1008FF78 */
173 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF80 */
174 /* Word */
175 0, 0x113, 0, 0, 0, 0, 0, 0, /* 1008FF88 */
176 /* MailFwd MyPics MyMusic*/
177 0x142, 0x164, 0x13c, 0, 0, 0, 0, 0, /* 1008FF90 */
178 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF98 */
179 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFA0 */
180 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFA8 */
181 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFB0 */
182 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFB8 */
183 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFC0 */
184 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFC8 */
185 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFD0 */
186 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFD8 */
187 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFE0 */
188 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFE8 */
189 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFF0 */
190 0, 0, 0, 0, 0, 0, 0, 0 /* 1008FFF8 */
191};
192
193/* This list was put together using /usr/include/X11/Sunkeysym.h and
194 comparing the scancodes produced by a Sun type 7 USB keyboard. Note that
195 Sun call F11 and F12 F36 and F37 respectively. */
196static const unsigned sun_key_scan[256] =
197{
198 /* FAGrav, FACirc, FATild, FAAcut, FADiae, FACed */
199 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF00 */
200 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF08 */
201 /* SunF36, SunF37 */
202 0x57, 0x58, 0, 0, 0, 0, 0, 0, /* 1005FF10 */
203 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF18 */
204 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF20 */
205 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF28 */
206 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF30 */
207 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF38 */
208 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF40 */
209 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF48 */
210 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF50 */
211 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF58 */
212 /* SysReq */
213 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF60 */
214 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF68 */
215 /* Props Front Copy Paste Cut Power Vol- Mute */
216 0x106, 0x10c, 0x178, 0x65, 0x13c, 0x15e, 0x12e, 0x120, /* 1005FF70 */
217 /* Vol+ */
218 0x130, 0, 0, 0, 0, 0, 0, 0, /* 1005FF78 */
219 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF80 */
220 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF88 */
221 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF90 */
222 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FF98 */
223 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFA0 */
224 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFA8 */
225 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFB0 */
226 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFB8 */
227 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFC0 */
228 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFC8 */
229 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFD0 */
230 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFD8 */
231 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFE0 */
232 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFE8 */
233 0, 0, 0, 0, 0, 0, 0, 0, /* 1005FFF0 */
234 0, 0, 0, 0, 0, 0, 0, 0 /* 1005FFF8 */
235};
236
237#include "xkbtoscan.h"
238
239#endif /* !___VBox_keyboard_tables_h */
240
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle
ContactPrivacy/Do Not Sell My InfoTerms of Use