2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
15 * The Original Code is libguac-client-rdp.
17 * The Initial Developer of the Original Code is
19 * Portions created by the Initial Developer are Copyright (C) 2011
20 * the Initial Developer. All Rights Reserved.
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.
37 * ***** END LICENSE BLOCK ***** */
39 #include <freerdp/input.h>
41 #include "rdp_keymap.h"
43 static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
46 { .keysym = 0x0020, .scancode = 0x39 },
49 { .keysym = 0x0021, .scancode = 0x02,
50 .set_keysyms = GUAC_KEYSYMS_SHIFT },
53 { .keysym = 0x0022, .scancode = 0x28,
54 .set_keysyms = GUAC_KEYSYMS_SHIFT },
57 { .keysym = 0x0023, .scancode = 0x04,
58 .set_keysyms = GUAC_KEYSYMS_SHIFT },
61 { .keysym = 0x0024, .scancode = 0x05,
62 .set_keysyms = GUAC_KEYSYMS_SHIFT },
65 { .keysym = 0x0025, .scancode = 0x06,
66 .set_keysyms = GUAC_KEYSYMS_SHIFT },
69 { .keysym = 0x0026, .scancode = 0x08,
70 .set_keysyms = GUAC_KEYSYMS_SHIFT },
73 { .keysym = 0x0027, .scancode = 0x28 },
76 { .keysym = 0x0028, .scancode = 0x0A,
77 .set_keysyms = GUAC_KEYSYMS_SHIFT },
80 { .keysym = 0x0029, .scancode = 0x0B,
81 .set_keysyms = GUAC_KEYSYMS_SHIFT },
84 { .keysym = 0x002a, .scancode = 0x09,
85 .set_keysyms = GUAC_KEYSYMS_SHIFT },
88 { .keysym = 0x002b, .scancode = 0x0D,
89 .set_keysyms = GUAC_KEYSYMS_SHIFT },
92 { .keysym = 0x002c, .scancode = 0x33,
93 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
96 { .keysym = 0x002d, .scancode = 0x0C,
97 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
100 { .keysym = 0x002e, .scancode = 0x34,
101 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
104 { .keysym = 0x002f, .scancode = 0x35,
105 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
108 { .keysym = 0x0030, .scancode = 0x0B,
109 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
112 { .keysym = 0x0031, .scancode = 0x02,
113 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
116 { .keysym = 0x0032, .scancode = 0x03,
117 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
120 { .keysym = 0x0033, .scancode = 0x04,
121 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
124 { .keysym = 0x0034, .scancode = 0x05,
125 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
128 { .keysym = 0x0035, .scancode = 0x06,
129 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
132 { .keysym = 0x0036, .scancode = 0x07,
133 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
136 { .keysym = 0x0037, .scancode = 0x08,
137 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
140 { .keysym = 0x0038, .scancode = 0x09,
141 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
144 { .keysym = 0x0039, .scancode = 0x0A,
145 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
148 { .keysym = 0x003a, .scancode = 0x27,
149 .set_keysyms = GUAC_KEYSYMS_SHIFT },
152 { .keysym = 0x003b, .scancode = 0x27,
153 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
156 { .keysym = 0x003c, .scancode = 0x33,
157 .set_keysyms = GUAC_KEYSYMS_SHIFT },
160 { .keysym = 0x003d, .scancode = 0x0D,
161 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
164 { .keysym = 0x003e, .scancode = 0x34,
165 .set_keysyms = GUAC_KEYSYMS_SHIFT },
168 { .keysym = 0x003f, .scancode = 0x35,
169 .set_keysyms = GUAC_KEYSYMS_SHIFT },
172 { .keysym = 0x0040, .scancode = 0x03,
173 .set_keysyms = GUAC_KEYSYMS_SHIFT },
176 { .keysym = 0x0041, .scancode = 0x1E,
177 .set_keysyms = GUAC_KEYSYMS_SHIFT },
180 { .keysym = 0x0042, .scancode = 0x30,
181 .set_keysyms = GUAC_KEYSYMS_SHIFT },
184 { .keysym = 0x0043, .scancode = 0x2E,
185 .set_keysyms = GUAC_KEYSYMS_SHIFT },
188 { .keysym = 0x0044, .scancode = 0x20,
189 .set_keysyms = GUAC_KEYSYMS_SHIFT },
192 { .keysym = 0x0045, .scancode = 0x12,
193 .set_keysyms = GUAC_KEYSYMS_SHIFT },
196 { .keysym = 0x0046, .scancode = 0x21,
197 .set_keysyms = GUAC_KEYSYMS_SHIFT },
200 { .keysym = 0x0047, .scancode = 0x22,
201 .set_keysyms = GUAC_KEYSYMS_SHIFT },
204 { .keysym = 0x0048, .scancode = 0x23,
205 .set_keysyms = GUAC_KEYSYMS_SHIFT },
208 { .keysym = 0x0049, .scancode = 0x17,
209 .set_keysyms = GUAC_KEYSYMS_SHIFT },
212 { .keysym = 0x004a, .scancode = 0x24,
213 .set_keysyms = GUAC_KEYSYMS_SHIFT },
216 { .keysym = 0x004b, .scancode = 0x25,
217 .set_keysyms = GUAC_KEYSYMS_SHIFT },
220 { .keysym = 0x004c, .scancode = 0x26,
221 .set_keysyms = GUAC_KEYSYMS_SHIFT },
224 { .keysym = 0x004d, .scancode = 0x32,
225 .set_keysyms = GUAC_KEYSYMS_SHIFT },
228 { .keysym = 0x004e, .scancode = 0x31,
229 .set_keysyms = GUAC_KEYSYMS_SHIFT },
232 { .keysym = 0x004f, .scancode = 0x18,
233 .set_keysyms = GUAC_KEYSYMS_SHIFT },
236 { .keysym = 0x0050, .scancode = 0x19,
237 .set_keysyms = GUAC_KEYSYMS_SHIFT },
240 { .keysym = 0x0051, .scancode = 0x10,
241 .set_keysyms = GUAC_KEYSYMS_SHIFT },
244 { .keysym = 0x0052, .scancode = 0x13,
245 .set_keysyms = GUAC_KEYSYMS_SHIFT },
248 { .keysym = 0x0053, .scancode = 0x1F,
249 .set_keysyms = GUAC_KEYSYMS_SHIFT },
252 { .keysym = 0x0054, .scancode = 0x14,
253 .set_keysyms = GUAC_KEYSYMS_SHIFT },
256 { .keysym = 0x0055, .scancode = 0x16,
257 .set_keysyms = GUAC_KEYSYMS_SHIFT },
260 { .keysym = 0x0056, .scancode = 0x2F,
261 .set_keysyms = GUAC_KEYSYMS_SHIFT },
264 { .keysym = 0x0057, .scancode = 0x11,
265 .set_keysyms = GUAC_KEYSYMS_SHIFT },
268 { .keysym = 0x0058, .scancode = 0x2D,
269 .set_keysyms = GUAC_KEYSYMS_SHIFT },
272 { .keysym = 0x0059, .scancode = 0x15,
273 .set_keysyms = GUAC_KEYSYMS_SHIFT },
276 { .keysym = 0x005a, .scancode = 0x2C,
277 .set_keysyms = GUAC_KEYSYMS_SHIFT },
280 { .keysym = 0x005b, .scancode = 0x1A,
281 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
284 { .keysym = 0x005c, .scancode = 0x2B,
285 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
288 { .keysym = 0x005d, .scancode = 0x1B,
289 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
292 { .keysym = 0x005e, .scancode = 0x07,
293 .set_keysyms = GUAC_KEYSYMS_SHIFT },
296 { .keysym = 0x005f, .scancode = 0x0C,
297 .set_keysyms = GUAC_KEYSYMS_SHIFT },
300 { .keysym = 0x0060, .scancode = 0x29,
301 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
304 { .keysym = 0x0061, .scancode = 0x1E,
305 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
308 { .keysym = 0x0062, .scancode = 0x30,
309 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
312 { .keysym = 0x0063, .scancode = 0x2E,
313 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
316 { .keysym = 0x0064, .scancode = 0x20,
317 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
320 { .keysym = 0x0065, .scancode = 0x12,
321 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
324 { .keysym = 0x0066, .scancode = 0x21,
325 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
328 { .keysym = 0x0067, .scancode = 0x22,
329 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
332 { .keysym = 0x0068, .scancode = 0x23,
333 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
336 { .keysym = 0x0069, .scancode = 0x17,
337 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
340 { .keysym = 0x006a, .scancode = 0x24,
341 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
344 { .keysym = 0x006b, .scancode = 0x25,
345 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
348 { .keysym = 0x006c, .scancode = 0x26,
349 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
352 { .keysym = 0x006d, .scancode = 0x32,
353 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
356 { .keysym = 0x006e, .scancode = 0x31,
357 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
360 { .keysym = 0x006f, .scancode = 0x18,
361 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
364 { .keysym = 0x0070, .scancode = 0x19,
365 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
368 { .keysym = 0x0071, .scancode = 0x10,
369 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
372 { .keysym = 0x0072, .scancode = 0x13,
373 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
376 { .keysym = 0x0073, .scancode = 0x1F,
377 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
380 { .keysym = 0x0074, .scancode = 0x14,
381 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
384 { .keysym = 0x0075, .scancode = 0x16,
385 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
388 { .keysym = 0x0076, .scancode = 0x2F,
389 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
392 { .keysym = 0x0077, .scancode = 0x11,
393 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
396 { .keysym = 0x0078, .scancode = 0x2D,
397 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
400 { .keysym = 0x0079, .scancode = 0x15,
401 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
404 { .keysym = 0x007a, .scancode = 0x2C,
405 .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
408 { .keysym = 0x007b, .scancode = 0x1A,
409 .set_keysyms = GUAC_KEYSYMS_SHIFT },
412 { .keysym = 0x007c, .scancode = 0x2B,
413 .set_keysyms = GUAC_KEYSYMS_SHIFT },
416 { .keysym = 0x007d, .scancode = 0x1B,
417 .set_keysyms = GUAC_KEYSYMS_SHIFT },
420 { .keysym = 0x007e, .scancode = 0x29,
421 .set_keysyms = GUAC_KEYSYMS_SHIFT },
427 const guac_rdp_keymap guac_rdp_keymap_en_us = {
429 .name = "en-us-qwerty",
431 .parent = &guac_rdp_keymap_base,
432 .mapping = __guac_rdp_keymap_mapping