Moved non-printable keys into base keymap.
[libguac-client-rdp.git] / src / rdp_keymap_en_us.c
1
2 /* ***** BEGIN LICENSE BLOCK *****
3  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4  *
5  * The contents of this file are subject to the Mozilla Public License Version
6  * 1.1 (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  * http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12  * for the specific language governing rights and limitations under the
13  * License.
14  *
15  * The Original Code is libguac-client-rdp.
16  *
17  * The Initial Developer of the Original Code is
18  * Michael Jumper.
19  * Portions created by the Initial Developer are Copyright (C) 2011
20  * the Initial Developer. All Rights Reserved.
21  *
22  * Contributor(s):
23  * Matt Hortman
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either the GNU General Public License Version 2 or later (the "GPL"), or
27  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
38
39 #include <freerdp/input.h>
40
41 #include "rdp_keymap.h"
42
43 static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
44
45     /* space */
46     { .keysym = 0x0020, .scancode = 0x39 },
47
48     /* exclam */
49     { .keysym = 0x0021, .scancode = 0x02,
50         .set_keysyms = GUAC_KEYSYMS_SHIFT },
51
52     /* quotedbl */
53     { .keysym = 0x0022, .scancode = 0x28,
54         .set_keysyms = GUAC_KEYSYMS_SHIFT },
55
56     /* numbersign */
57     { .keysym = 0x0023, .scancode = 0x04,
58         .set_keysyms = GUAC_KEYSYMS_SHIFT },
59
60     /* dollar */
61     { .keysym = 0x0024, .scancode = 0x05,
62         .set_keysyms = GUAC_KEYSYMS_SHIFT },
63
64     /* percent */
65     { .keysym = 0x0025, .scancode = 0x06,
66         .set_keysyms = GUAC_KEYSYMS_SHIFT },
67
68     /* ampersand */
69     { .keysym = 0x0026, .scancode = 0x08,
70         .set_keysyms = GUAC_KEYSYMS_SHIFT },
71
72     /* quoteright */
73     { .keysym = 0x0027, .scancode = 0x28 },
74
75     /* parenleft */
76     { .keysym = 0x0028, .scancode = 0x0A,
77         .set_keysyms = GUAC_KEYSYMS_SHIFT },
78
79     /* parenright */
80     { .keysym = 0x0029, .scancode = 0x0B,
81         .set_keysyms = GUAC_KEYSYMS_SHIFT },
82
83     /* asterisk */
84     { .keysym = 0x002a, .scancode = 0x09,
85         .set_keysyms = GUAC_KEYSYMS_SHIFT },
86
87     /* plus */
88     { .keysym = 0x002b, .scancode = 0x0D,
89         .set_keysyms = GUAC_KEYSYMS_SHIFT },
90
91     /* comma */
92     { .keysym = 0x002c, .scancode = 0x33 },
93
94     /* minus */
95     { .keysym = 0x002d, .scancode = 0x0C },
96
97     /* period */
98     { .keysym = 0x002e, .scancode = 0x34 },
99
100     /* slash */
101     { .keysym = 0x002f, .scancode = 0x35 },
102
103     /* 0 */
104     { .keysym = 0x0030, .scancode = 0x0B },
105
106     /* 1 */
107     { .keysym = 0x0031, .scancode = 0x02 },
108
109     /* 2 */
110     { .keysym = 0x0032, .scancode = 0x03 },
111
112     /* 3 */
113     { .keysym = 0x0033, .scancode = 0x04 },
114
115     /* 4 */
116     { .keysym = 0x0034, .scancode = 0x05 },
117
118     /* 5 */
119     { .keysym = 0x0035, .scancode = 0x06 },
120
121     /* 6 */
122     { .keysym = 0x0036, .scancode = 0x07 },
123
124     /* 7 */
125     { .keysym = 0x0037, .scancode = 0x08 },
126
127     /* 8 */
128     { .keysym = 0x0038, .scancode = 0x09 },
129
130     /* 9 */
131     { .keysym = 0x0039, .scancode = 0x0A },
132
133     /* colon */
134     { .keysym = 0x003a, .scancode = 0x27,
135         .set_keysyms = GUAC_KEYSYMS_SHIFT },
136
137     /* semicolon */
138     { .keysym = 0x003b, .scancode = 0x27 },
139
140     /* less */
141     { .keysym = 0x003c, .scancode = 0x33,
142         .set_keysyms = GUAC_KEYSYMS_SHIFT },
143
144     /* equal */
145     { .keysym = 0x003d, .scancode = 0x0D },
146
147     /* greater */
148     { .keysym = 0x003e, .scancode = 0x34,
149         .set_keysyms = GUAC_KEYSYMS_SHIFT },
150
151     /* question */
152     { .keysym = 0x003f, .scancode = 0x35,
153         .set_keysyms = GUAC_KEYSYMS_SHIFT },
154
155     /* at */
156     { .keysym = 0x0040, .scancode = 0x03,
157         .set_keysyms = GUAC_KEYSYMS_SHIFT },
158
159     /* A */
160     { .keysym = 0x0041, .scancode = 0x1E,
161         .set_keysyms = GUAC_KEYSYMS_SHIFT },
162
163     /* B */
164     { .keysym = 0x0042, .scancode = 0x30,
165         .set_keysyms = GUAC_KEYSYMS_SHIFT },
166
167     /* C */
168     { .keysym = 0x0043, .scancode = 0x2E,
169         .set_keysyms = GUAC_KEYSYMS_SHIFT },
170
171     /* D */
172     { .keysym = 0x0044, .scancode = 0x20,
173         .set_keysyms = GUAC_KEYSYMS_SHIFT },
174
175     /* E */
176     { .keysym = 0x0045, .scancode = 0x12,
177         .set_keysyms = GUAC_KEYSYMS_SHIFT },
178
179     /* F */
180     { .keysym = 0x0046, .scancode = 0x21,
181         .set_keysyms = GUAC_KEYSYMS_SHIFT },
182
183     /* G */
184     { .keysym = 0x0047, .scancode = 0x22,
185         .set_keysyms = GUAC_KEYSYMS_SHIFT },
186
187     /* H */
188     { .keysym = 0x0048, .scancode = 0x23,
189         .set_keysyms = GUAC_KEYSYMS_SHIFT },
190
191     /* I */
192     { .keysym = 0x0049, .scancode = 0x17,
193         .set_keysyms = GUAC_KEYSYMS_SHIFT },
194
195     /* J */
196     { .keysym = 0x004a, .scancode = 0x24,
197         .set_keysyms = GUAC_KEYSYMS_SHIFT },
198
199     /* K */
200     { .keysym = 0x004b, .scancode = 0x25,
201         .set_keysyms = GUAC_KEYSYMS_SHIFT },
202
203     /* L */
204     { .keysym = 0x004c, .scancode = 0x26,
205         .set_keysyms = GUAC_KEYSYMS_SHIFT },
206
207     /* M */
208     { .keysym = 0x004d, .scancode = 0x32,
209         .set_keysyms = GUAC_KEYSYMS_SHIFT },
210
211     /* N */
212     { .keysym = 0x004e, .scancode = 0x31,
213         .set_keysyms = GUAC_KEYSYMS_SHIFT },
214
215     /* O */
216     { .keysym = 0x004f, .scancode = 0x18,
217         .set_keysyms = GUAC_KEYSYMS_SHIFT },
218
219     /* P */
220     { .keysym = 0x0050, .scancode = 0x19,
221         .set_keysyms = GUAC_KEYSYMS_SHIFT },
222
223     /* Q */
224     { .keysym = 0x0051, .scancode = 0x10,
225         .set_keysyms = GUAC_KEYSYMS_SHIFT },
226
227     /* R */
228     { .keysym = 0x0052, .scancode = 0x13,
229         .set_keysyms = GUAC_KEYSYMS_SHIFT },
230
231     /* S */
232     { .keysym = 0x0053, .scancode = 0x1F,
233         .set_keysyms = GUAC_KEYSYMS_SHIFT },
234
235     /* T */
236     { .keysym = 0x0054, .scancode = 0x14,
237         .set_keysyms = GUAC_KEYSYMS_SHIFT },
238
239     /* U */
240     { .keysym = 0x0055, .scancode = 0x16,
241         .set_keysyms = GUAC_KEYSYMS_SHIFT },
242
243     /* V */
244     { .keysym = 0x0056, .scancode = 0x2F,
245         .set_keysyms = GUAC_KEYSYMS_SHIFT },
246
247     /* W */
248     { .keysym = 0x0057, .scancode = 0x11,
249         .set_keysyms = GUAC_KEYSYMS_SHIFT },
250
251     /* X */
252     { .keysym = 0x0058, .scancode = 0x2D,
253         .set_keysyms = GUAC_KEYSYMS_SHIFT },
254
255     /* Y */
256     { .keysym = 0x0059, .scancode = 0x15,
257         .set_keysyms = GUAC_KEYSYMS_SHIFT },
258
259     /* Z */
260     { .keysym = 0x005a, .scancode = 0x2C,
261         .set_keysyms = GUAC_KEYSYMS_SHIFT },
262
263     /* bracketleft */
264     { .keysym = 0x005b, .scancode = 0x1A },
265
266     /* backslash */
267     { .keysym = 0x005c, .scancode = 0x2B },
268
269     /* bracketright */
270     { .keysym = 0x005d, .scancode = 0x1B },
271
272     /* asciicircum */
273     { .keysym = 0x005e, .scancode = 0x29,
274         .set_keysyms = GUAC_KEYSYMS_SHIFT },
275
276     /* underscore */
277     { .keysym = 0x005f, .scancode = 0x0C,
278         .set_keysyms = GUAC_KEYSYMS_SHIFT },
279
280     /* quoteleft */
281     { .keysym = 0x0060, .scancode = 0x29 },
282
283     /* a */
284     { .keysym = 0x0061, .scancode = 0x1E },
285
286     /* b */
287     { .keysym = 0x0062, .scancode = 0x30 },
288
289     /* c */
290     { .keysym = 0x0063, .scancode = 0x2E },
291
292     /* d */
293     { .keysym = 0x0064, .scancode = 0x20 },
294
295     /* e */
296     { .keysym = 0x0065, .scancode = 0x12 },
297
298     /* f */
299     { .keysym = 0x0066, .scancode = 0x21 },
300
301     /* g */
302     { .keysym = 0x0067, .scancode = 0x22 },
303
304     /* h */
305     { .keysym = 0x0068, .scancode = 0x23 },
306
307     /* i */
308     { .keysym = 0x0069, .scancode = 0x17 },
309
310     /* j */
311     { .keysym = 0x006a, .scancode = 0x24 },
312
313     /* k */
314     { .keysym = 0x006b, .scancode = 0x25 },
315
316     /* l */
317     { .keysym = 0x006c, .scancode = 0x26 },
318
319     /* m */
320     { .keysym = 0x006d, .scancode = 0x32 },
321
322     /* n */
323     { .keysym = 0x006e, .scancode = 0x31 },
324
325     /* o */
326     { .keysym = 0x006f, .scancode = 0x18 },
327
328     /* p */
329     { .keysym = 0x0070, .scancode = 0x19 },
330
331     /* q */
332     { .keysym = 0x0071, .scancode = 0x10 },
333
334     /* r */
335     { .keysym = 0x0072, .scancode = 0x13 },
336
337     /* s */
338     { .keysym = 0x0073, .scancode = 0x1F },
339
340     /* t */
341     { .keysym = 0x0074, .scancode = 0x14 },
342
343     /* u */
344     { .keysym = 0x0075, .scancode = 0x16 },
345
346     /* v */
347     { .keysym = 0x0076, .scancode = 0x2F },
348
349     /* w */
350     { .keysym = 0x0077, .scancode = 0x11 },
351
352     /* x */
353     { .keysym = 0x0078, .scancode = 0x2D },
354
355     /* y */
356     { .keysym = 0x0079, .scancode = 0x15 },
357
358     /* z */
359     { .keysym = 0x007a, .scancode = 0x2C },
360
361     /* braceleft */
362     { .keysym = 0x007b, .scancode = 0x1A,
363         .set_keysyms = GUAC_KEYSYMS_SHIFT },
364
365     /* bar */
366     { .keysym = 0x007c, .scancode = 0x2B,
367         .set_keysyms = GUAC_KEYSYMS_SHIFT },
368
369     /* braceright */
370     { .keysym = 0x007d, .scancode = 0x1B,
371         .set_keysyms = GUAC_KEYSYMS_SHIFT },
372
373     /* asciitilde */
374     { .keysym = 0x007e, .scancode = 0x29,
375         .set_keysyms = GUAC_KEYSYMS_SHIFT },
376
377     {0}
378
379 };
380
381 const guac_rdp_keymap guac_rdp_keymap_en_us = {
382
383     .name = "en-us-qwerty",
384
385     .parent = &guac_rdp_keymap_base,
386     .mapping = __guac_rdp_keymap_mapping
387
388 };
389