22f614225aa6c39f8f697e9a6cdfa2e0d7a9f28a
[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 <freerdp/locale/keyboard.h>
42
43 #include "rdp_keymap.h"
44
45 static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
46
47     /* space */
48     { .keysym = 0x0020, .scancode = 0x39 },
49
50     /* exclam */
51     { .keysym = 0x0021, .scancode = 0x02,
52         .set_keysyms = GUAC_KEYSYMS_SHIFT },
53
54     /* quotedbl */
55     { .keysym = 0x0022, .scancode = 0x28,
56         .set_keysyms = GUAC_KEYSYMS_SHIFT },
57
58     /* numbersign */
59     { .keysym = 0x0023, .scancode = 0x04,
60         .set_keysyms = GUAC_KEYSYMS_SHIFT },
61
62     /* dollar */
63     { .keysym = 0x0024, .scancode = 0x05,
64         .set_keysyms = GUAC_KEYSYMS_SHIFT },
65
66     /* percent */
67     { .keysym = 0x0025, .scancode = 0x06,
68         .set_keysyms = GUAC_KEYSYMS_SHIFT },
69
70     /* ampersand */
71     { .keysym = 0x0026, .scancode = 0x08,
72         .set_keysyms = GUAC_KEYSYMS_SHIFT },
73
74     /* quoteright */
75     { .keysym = 0x0027, .scancode = 0x28 },
76
77     /* parenleft */
78     { .keysym = 0x0028, .scancode = 0x0A,
79         .set_keysyms = GUAC_KEYSYMS_SHIFT },
80
81     /* parenright */
82     { .keysym = 0x0029, .scancode = 0x0B,
83         .set_keysyms = GUAC_KEYSYMS_SHIFT },
84
85     /* asterisk */
86     { .keysym = 0x002a, .scancode = 0x09,
87         .set_keysyms = GUAC_KEYSYMS_SHIFT },
88
89     /* plus */
90     { .keysym = 0x002b, .scancode = 0x0D,
91         .set_keysyms = GUAC_KEYSYMS_SHIFT },
92
93     /* comma */
94     { .keysym = 0x002c, .scancode = 0x33,
95         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
96
97     /* minus */
98     { .keysym = 0x002d, .scancode = 0x0C,
99         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
100
101     /* period */
102     { .keysym = 0x002e, .scancode = 0x34,
103         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
104
105     /* slash */
106     { .keysym = 0x002f, .scancode = 0x35,
107         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
108
109     /* 0 */
110     { .keysym = 0x0030, .scancode = 0x0B,
111         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
112
113     /* 1 */
114     { .keysym = 0x0031, .scancode = 0x02,
115         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
116
117     /* 2 */
118     { .keysym = 0x0032, .scancode = 0x03,
119         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
120
121     /* 3 */
122     { .keysym = 0x0033, .scancode = 0x04,
123         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
124
125     /* 4 */
126     { .keysym = 0x0034, .scancode = 0x05,
127         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
128
129     /* 5 */
130     { .keysym = 0x0035, .scancode = 0x06,
131         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
132
133     /* 6 */
134     { .keysym = 0x0036, .scancode = 0x07,
135         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
136
137     /* 7 */
138     { .keysym = 0x0037, .scancode = 0x08,
139         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
140
141     /* 8 */
142     { .keysym = 0x0038, .scancode = 0x09,
143         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
144
145     /* 9 */
146     { .keysym = 0x0039, .scancode = 0x0A,
147         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
148
149     /* colon */
150     { .keysym = 0x003a, .scancode = 0x27,
151         .set_keysyms = GUAC_KEYSYMS_SHIFT },
152
153     /* semicolon */
154     { .keysym = 0x003b, .scancode = 0x27,
155         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
156
157     /* less */
158     { .keysym = 0x003c, .scancode = 0x33,
159         .set_keysyms = GUAC_KEYSYMS_SHIFT },
160
161     /* equal */
162     { .keysym = 0x003d, .scancode = 0x0D,
163         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
164
165     /* greater */
166     { .keysym = 0x003e, .scancode = 0x34,
167         .set_keysyms = GUAC_KEYSYMS_SHIFT },
168
169     /* question */
170     { .keysym = 0x003f, .scancode = 0x35,
171         .set_keysyms = GUAC_KEYSYMS_SHIFT },
172
173     /* at */
174     { .keysym = 0x0040, .scancode = 0x03,
175         .set_keysyms = GUAC_KEYSYMS_SHIFT },
176
177     /* A */
178     { .keysym = 0x0041, .scancode = 0x1E,
179         .set_keysyms = GUAC_KEYSYMS_SHIFT },
180
181     /* B */
182     { .keysym = 0x0042, .scancode = 0x30,
183         .set_keysyms = GUAC_KEYSYMS_SHIFT },
184
185     /* C */
186     { .keysym = 0x0043, .scancode = 0x2E,
187         .set_keysyms = GUAC_KEYSYMS_SHIFT },
188
189     /* D */
190     { .keysym = 0x0044, .scancode = 0x20,
191         .set_keysyms = GUAC_KEYSYMS_SHIFT },
192
193     /* E */
194     { .keysym = 0x0045, .scancode = 0x12,
195         .set_keysyms = GUAC_KEYSYMS_SHIFT },
196
197     /* F */
198     { .keysym = 0x0046, .scancode = 0x21,
199         .set_keysyms = GUAC_KEYSYMS_SHIFT },
200
201     /* G */
202     { .keysym = 0x0047, .scancode = 0x22,
203         .set_keysyms = GUAC_KEYSYMS_SHIFT },
204
205     /* H */
206     { .keysym = 0x0048, .scancode = 0x23,
207         .set_keysyms = GUAC_KEYSYMS_SHIFT },
208
209     /* I */
210     { .keysym = 0x0049, .scancode = 0x17,
211         .set_keysyms = GUAC_KEYSYMS_SHIFT },
212
213     /* J */
214     { .keysym = 0x004a, .scancode = 0x24,
215         .set_keysyms = GUAC_KEYSYMS_SHIFT },
216
217     /* K */
218     { .keysym = 0x004b, .scancode = 0x25,
219         .set_keysyms = GUAC_KEYSYMS_SHIFT },
220
221     /* L */
222     { .keysym = 0x004c, .scancode = 0x26,
223         .set_keysyms = GUAC_KEYSYMS_SHIFT },
224
225     /* M */
226     { .keysym = 0x004d, .scancode = 0x32,
227         .set_keysyms = GUAC_KEYSYMS_SHIFT },
228
229     /* N */
230     { .keysym = 0x004e, .scancode = 0x31,
231         .set_keysyms = GUAC_KEYSYMS_SHIFT },
232
233     /* O */
234     { .keysym = 0x004f, .scancode = 0x18,
235         .set_keysyms = GUAC_KEYSYMS_SHIFT },
236
237     /* P */
238     { .keysym = 0x0050, .scancode = 0x19,
239         .set_keysyms = GUAC_KEYSYMS_SHIFT },
240
241     /* Q */
242     { .keysym = 0x0051, .scancode = 0x10,
243         .set_keysyms = GUAC_KEYSYMS_SHIFT },
244
245     /* R */
246     { .keysym = 0x0052, .scancode = 0x13,
247         .set_keysyms = GUAC_KEYSYMS_SHIFT },
248
249     /* S */
250     { .keysym = 0x0053, .scancode = 0x1F,
251         .set_keysyms = GUAC_KEYSYMS_SHIFT },
252
253     /* T */
254     { .keysym = 0x0054, .scancode = 0x14,
255         .set_keysyms = GUAC_KEYSYMS_SHIFT },
256
257     /* U */
258     { .keysym = 0x0055, .scancode = 0x16,
259         .set_keysyms = GUAC_KEYSYMS_SHIFT },
260
261     /* V */
262     { .keysym = 0x0056, .scancode = 0x2F,
263         .set_keysyms = GUAC_KEYSYMS_SHIFT },
264
265     /* W */
266     { .keysym = 0x0057, .scancode = 0x11,
267         .set_keysyms = GUAC_KEYSYMS_SHIFT },
268
269     /* X */
270     { .keysym = 0x0058, .scancode = 0x2D,
271         .set_keysyms = GUAC_KEYSYMS_SHIFT },
272
273     /* Y */
274     { .keysym = 0x0059, .scancode = 0x15,
275         .set_keysyms = GUAC_KEYSYMS_SHIFT },
276
277     /* Z */
278     { .keysym = 0x005a, .scancode = 0x2C,
279         .set_keysyms = GUAC_KEYSYMS_SHIFT },
280
281     /* bracketleft */
282     { .keysym = 0x005b, .scancode = 0x1A,
283         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
284
285     /* backslash */
286     { .keysym = 0x005c, .scancode = 0x2B,
287         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
288
289     /* bracketright */
290     { .keysym = 0x005d, .scancode = 0x1B,
291         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
292
293     /* asciicircum */
294     { .keysym = 0x005e, .scancode = 0x07,
295         .set_keysyms = GUAC_KEYSYMS_SHIFT },
296
297     /* underscore */
298     { .keysym = 0x005f, .scancode = 0x0C,
299         .set_keysyms = GUAC_KEYSYMS_SHIFT },
300
301     /* quoteleft */
302     { .keysym = 0x0060, .scancode = 0x29,
303         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
304
305     /* a */
306     { .keysym = 0x0061, .scancode = 0x1E,
307         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
308
309     /* b */
310     { .keysym = 0x0062, .scancode = 0x30,
311         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
312
313     /* c */
314     { .keysym = 0x0063, .scancode = 0x2E,
315         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
316
317     /* d */
318     { .keysym = 0x0064, .scancode = 0x20,
319         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
320
321     /* e */
322     { .keysym = 0x0065, .scancode = 0x12,
323         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
324
325     /* f */
326     { .keysym = 0x0066, .scancode = 0x21,
327         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
328
329     /* g */
330     { .keysym = 0x0067, .scancode = 0x22,
331         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
332
333     /* h */
334     { .keysym = 0x0068, .scancode = 0x23,
335         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
336
337     /* i */
338     { .keysym = 0x0069, .scancode = 0x17,
339         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
340
341     /* j */
342     { .keysym = 0x006a, .scancode = 0x24,
343         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
344
345     /* k */
346     { .keysym = 0x006b, .scancode = 0x25,
347         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
348
349     /* l */
350     { .keysym = 0x006c, .scancode = 0x26,
351         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
352
353     /* m */
354     { .keysym = 0x006d, .scancode = 0x32,
355         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
356
357     /* n */
358     { .keysym = 0x006e, .scancode = 0x31,
359         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
360
361     /* o */
362     { .keysym = 0x006f, .scancode = 0x18,
363         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
364
365     /* p */
366     { .keysym = 0x0070, .scancode = 0x19,
367         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
368
369     /* q */
370     { .keysym = 0x0071, .scancode = 0x10,
371         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
372
373     /* r */
374     { .keysym = 0x0072, .scancode = 0x13,
375         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
376
377     /* s */
378     { .keysym = 0x0073, .scancode = 0x1F,
379         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
380
381     /* t */
382     { .keysym = 0x0074, .scancode = 0x14,
383         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
384
385     /* u */
386     { .keysym = 0x0075, .scancode = 0x16,
387         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
388
389     /* v */
390     { .keysym = 0x0076, .scancode = 0x2F,
391         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
392
393     /* w */
394     { .keysym = 0x0077, .scancode = 0x11,
395         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
396
397     /* x */
398     { .keysym = 0x0078, .scancode = 0x2D,
399         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
400
401     /* y */
402     { .keysym = 0x0079, .scancode = 0x15,
403         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
404
405     /* z */
406     { .keysym = 0x007a, .scancode = 0x2C,
407         .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
408
409     /* braceleft */
410     { .keysym = 0x007b, .scancode = 0x1A,
411         .set_keysyms = GUAC_KEYSYMS_SHIFT },
412
413     /* bar */
414     { .keysym = 0x007c, .scancode = 0x2B,
415         .set_keysyms = GUAC_KEYSYMS_SHIFT },
416
417     /* braceright */
418     { .keysym = 0x007d, .scancode = 0x1B,
419         .set_keysyms = GUAC_KEYSYMS_SHIFT },
420
421     /* asciitilde */
422     { .keysym = 0x007e, .scancode = 0x29,
423         .set_keysyms = GUAC_KEYSYMS_SHIFT },
424
425     {0}
426
427 };
428
429 const guac_rdp_keymap guac_rdp_keymap_en_us = {
430
431     .name = "en-us-qwerty",
432
433     .parent = &guac_rdp_keymap_base,
434     .mapping = __guac_rdp_keymap_mapping,
435     .freerdp_keyboard_layout = KBD_US
436
437 };
438