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 },
52 { .keysym = 0x0022, .scancode = 0x28 },
55 { .keysym = 0x0023, .scancode = 0x04 },
58 { .keysym = 0x0024, .scancode = 0x05,
59 .set_keysyms = GUAC_KEYSYMS_SHIFT },
62 { .keysym = 0x0025, .scancode = 0x06 },
65 { .keysym = 0x0026, .scancode = 0x08 },
68 { .keysym = 0x0027, .scancode = 0x28 },
71 { .keysym = 0x0028, .scancode = 0x0A },
74 { .keysym = 0x0029, .scancode = 0x0B },
77 { .keysym = 0x002a, .scancode = 0x09 },
80 { .keysym = 0x002b, .scancode = 0x0D },
83 { .keysym = 0x002c, .scancode = 0x33 },
86 { .keysym = 0x002d, .scancode = 0x0C },
89 { .keysym = 0x002e, .scancode = 0x34 },
92 { .keysym = 0x002f, .scancode = 0x35 },
95 { .keysym = 0x0030, .scancode = 0x0B },
98 { .keysym = 0x0031, .scancode = 0x02 },
101 { .keysym = 0x0032, .scancode = 0x03 },
104 { .keysym = 0x0033, .scancode = 0x04 },
107 { .keysym = 0x0034, .scancode = 0x05 },
110 { .keysym = 0x0035, .scancode = 0x06 },
113 { .keysym = 0x0036, .scancode = 0x07 },
116 { .keysym = 0x0037, .scancode = 0x08 },
119 { .keysym = 0x0038, .scancode = 0x09 },
122 { .keysym = 0x0039, .scancode = 0x0A },
125 { .keysym = 0x003a, .scancode = 0x27 },
128 { .keysym = 0x003b, .scancode = 0x27 },
131 { .keysym = 0x003c, .scancode = 0x33 },
134 { .keysym = 0x003d, .scancode = 0x0D },
137 { .keysym = 0x003e, .scancode = 0x34 },
140 { .keysym = 0x003f, .scancode = 0x35 },
143 { .keysym = 0x0040, .scancode = 0x03 },
146 { .keysym = 0x0041, .scancode = 0x1E },
149 { .keysym = 0x0042, .scancode = 0x30 },
152 { .keysym = 0x0043, .scancode = 0x2E },
155 { .keysym = 0x0044, .scancode = 0x20 },
158 { .keysym = 0x0045, .scancode = 0x12 },
161 { .keysym = 0x0046, .scancode = 0x21 },
164 { .keysym = 0x0047, .scancode = 0x22 },
167 { .keysym = 0x0048, .scancode = 0x23 },
170 { .keysym = 0x0049, .scancode = 0x17 },
173 { .keysym = 0x004a, .scancode = 0x24 },
176 { .keysym = 0x004b, .scancode = 0x25 },
179 { .keysym = 0x004c, .scancode = 0x26 },
182 { .keysym = 0x004d, .scancode = 0x32 },
185 { .keysym = 0x004e, .scancode = 0x31 },
188 { .keysym = 0x004f, .scancode = 0x18 },
191 { .keysym = 0x0050, .scancode = 0x19 },
194 { .keysym = 0x0051, .scancode = 0x10 },
197 { .keysym = 0x0052, .scancode = 0x13 },
200 { .keysym = 0x0053, .scancode = 0x1F },
203 { .keysym = 0x0054, .scancode = 0x14 },
206 { .keysym = 0x0055, .scancode = 0x16 },
209 { .keysym = 0x0056, .scancode = 0x2F },
212 { .keysym = 0x0057, .scancode = 0x11 },
215 { .keysym = 0x0058, .scancode = 0x2D },
218 { .keysym = 0x0059, .scancode = 0x15 },
221 { .keysym = 0x005a, .scancode = 0x2C },
224 { .keysym = 0x005b, .scancode = 0x1A },
227 { .keysym = 0x005c, .scancode = 0x2B },
230 { .keysym = 0x005d, .scancode = 0x1B },
233 { .keysym = 0x005e, .scancode = 0x29 },
236 { .keysym = 0x005f, .scancode = 0x0C },
239 { .keysym = 0x0060, .scancode = 0x29 },
242 { .keysym = 0x0061, .scancode = 0x1E },
245 { .keysym = 0x0062, .scancode = 0x30 },
248 { .keysym = 0x0063, .scancode = 0x2E },
251 { .keysym = 0x0064, .scancode = 0x20 },
254 { .keysym = 0x0065, .scancode = 0x12 },
257 { .keysym = 0x0066, .scancode = 0x21 },
260 { .keysym = 0x0067, .scancode = 0x22 },
263 { .keysym = 0x0068, .scancode = 0x23 },
266 { .keysym = 0x0069, .scancode = 0x17 },
269 { .keysym = 0x006a, .scancode = 0x24 },
272 { .keysym = 0x006b, .scancode = 0x25 },
275 { .keysym = 0x006c, .scancode = 0x26 },
278 { .keysym = 0x006d, .scancode = 0x32 },
281 { .keysym = 0x006e, .scancode = 0x31 },
284 { .keysym = 0x006f, .scancode = 0x18 },
287 { .keysym = 0x0070, .scancode = 0x19 },
290 { .keysym = 0x0071, .scancode = 0x10 },
293 { .keysym = 0x0072, .scancode = 0x13 },
296 { .keysym = 0x0073, .scancode = 0x1F },
299 { .keysym = 0x0074, .scancode = 0x14 },
302 { .keysym = 0x0075, .scancode = 0x16 },
305 { .keysym = 0x0076, .scancode = 0x2F },
308 { .keysym = 0x0077, .scancode = 0x11 },
311 { .keysym = 0x0078, .scancode = 0x2D },
314 { .keysym = 0x0079, .scancode = 0x15 },
317 { .keysym = 0x007a, .scancode = 0x2C },
320 { .keysym = 0x007b, .scancode = 0x1A },
323 { .keysym = 0x007c, .scancode = 0x2B },
326 { .keysym = 0x007d, .scancode = 0x1B },
329 { .keysym = 0x007e, .scancode = 0x29 },
332 { .keysym = 0xff08, .scancode = 0x0E },
335 { .keysym = 0xff09, .scancode = 0x0F },
338 { .keysym = 0xff0d, .scancode = 0x1C },
341 { .keysym = 0xff51, .scancode = 0x4B,
342 .flags = KBD_FLAGS_EXTENDED },
345 { .keysym = 0xff52, .scancode = 0x48,
346 .flags = KBD_FLAGS_EXTENDED },
349 { .keysym = 0xff53, .scancode = 0x4D,
350 .flags = KBD_FLAGS_EXTENDED },
353 { .keysym = 0xff54, .scancode = 0x50,
354 .flags = KBD_FLAGS_EXTENDED },
357 { .keysym = 0xff67, .scancode = 0x5D,
358 .flags = KBD_FLAGS_EXTENDED },
361 { .keysym = 0xffb0, .scancode = 0x52 },
364 { .keysym = 0xffb1, .scancode = 0x4F },
367 { .keysym = 0xffb2, .scancode = 0x50 },
370 { .keysym = 0xffb3, .scancode = 0x51 },
373 { .keysym = 0xffb4, .scancode = 0x4B },
376 { .keysym = 0xffb5, .scancode = 0x4C },
379 { .keysym = 0xffb6, .scancode = 0x4D },
382 { .keysym = 0xffb7, .scancode = 0x47 },
385 { .keysym = 0xffb8, .scancode = 0x48 },
388 { .keysym = 0xffb9, .scancode = 0x49 },
391 { .keysym = 0xffe1, .scancode = 0x2A },
394 { .keysym = 0xffe2, .scancode = 0x36 },
397 { .keysym = 0xffe3, .scancode = 0x1D },
400 { .keysym = 0xffe4, .scancode = 0x1D },
403 { .keysym = 0xffe9, .scancode = 0x38 },
406 { .keysym = 0xffea, .scancode = 0x38 },
409 { .keysym = 0xffeb, .scancode = 0x5B,
410 .flags = KBD_FLAGS_EXTENDED },
413 { .keysym = 0xffec, .scancode = 0x5C,
414 .flags = KBD_FLAGS_EXTENDED },
417 { .keysym = 0xffff, .scancode = 0x53,
418 .flags = KBD_FLAGS_EXTENDED },
424 const guac_rdp_keymap guac_rdp_keymap_en_us = {
426 .name = "en-us-qwerty",
429 .mapping = __guac_rdp_keymap_mapping