VirtualBox

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

Last change on this file since 29743 was 29720, checked in by vboxsync, 15 years ago

FE/Common/: fix the meta key mapping on X11 hosts

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette