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