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