Finish base keymap.
[libguac-client-rdp.git] / src / rdp_keymap_base.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     /* BackSpace */
46     { .keysym = 0xff08, .scancode = 0x0E },
47
48     /* Tab */
49     { .keysym = 0xff09, .scancode = 0x0F },
50
51     /* Return */
52     { .keysym = 0xff0d, .scancode = 0x1C },
53
54     /* Scroll_Lock */
55     { .keysym = 0xff14, .scancode = 0x46 },
56
57     /* Escape */
58     { .keysym = 0xff1b, .scancode = 0x01 },
59
60     /* Home */
61     { .keysym = 0xff50, .scancode = 0x47,
62         .flags = KBD_FLAGS_EXTENDED },
63
64     /* Left */
65     { .keysym = 0xff51, .scancode = 0x4B,
66         .flags = KBD_FLAGS_EXTENDED },
67
68     /* Up */
69     { .keysym = 0xff52, .scancode = 0x48,
70         .flags = KBD_FLAGS_EXTENDED },
71
72     /* Right */
73     { .keysym = 0xff53, .scancode = 0x4D,
74         .flags = KBD_FLAGS_EXTENDED },
75
76     /* Down */
77     { .keysym = 0xff54, .scancode = 0x50,
78         .flags = KBD_FLAGS_EXTENDED },
79
80     /* Page_Up */
81     { .keysym = 0xff55, .scancode = 0x49,
82         .flags = KBD_FLAGS_EXTENDED },
83
84     /* Menu */
85     { .keysym = 0xff67, .scancode = 0x5D,
86         .flags = KBD_FLAGS_EXTENDED },
87
88     /* Page_Down */
89     { .keysym = 0xff56, .scancode = 0x51,
90         .flags = KBD_FLAGS_EXTENDED },
91
92     /* End */
93     { .keysym = 0xff57, .scancode = 0x4F,
94         .flags = KBD_FLAGS_EXTENDED },
95
96     /* Insert */
97     { .keysym = 0xff63, .scancode = 0x52,
98         .flags = KBD_FLAGS_EXTENDED },
99
100     /* Num_Lock */
101     { .keysym = 0xff7f, .scancode = 0x45 },
102
103     /* KP_0 */
104     { .keysym = 0xffb0, .scancode = 0x52 },
105
106     /* KP_1 */
107     { .keysym = 0xffb1, .scancode = 0x4F },
108
109     /* KP_2 */
110     { .keysym = 0xffb2, .scancode = 0x50 },
111
112     /* KP_3 */
113     { .keysym = 0xffb3, .scancode = 0x51 },
114
115     /* KP_4 */
116     { .keysym = 0xffb4, .scancode = 0x4B },
117
118     /* KP_5 */
119     { .keysym = 0xffb5, .scancode = 0x4C },
120
121     /* KP_6 */
122     { .keysym = 0xffb6, .scancode = 0x4D },
123
124     /* KP_7 */
125     { .keysym = 0xffb7, .scancode = 0x47 },
126
127     /* KP_8 */
128     { .keysym = 0xffb8, .scancode = 0x48 },
129
130     /* KP_9 */
131     { .keysym = 0xffb9, .scancode = 0x49 },
132
133     /* F1 */
134     { .keysym = 0xffbe, .scancode = 0x3B },
135
136     /* F2 */
137     { .keysym = 0xffbf, .scancode = 0x3C },
138
139     /* F3 */
140     { .keysym = 0xffc0, .scancode = 0x3D },
141
142     /* F4 */
143     { .keysym = 0xffc1, .scancode = 0x3E },
144
145     /* F5 */
146     { .keysym = 0xffc2, .scancode = 0x3F },
147
148     /* F6 */
149     { .keysym = 0xffc3, .scancode = 0x40 },
150
151     /* F7 */
152     { .keysym = 0xffc4, .scancode = 0x41 },
153
154     /* F8 */
155     { .keysym = 0xffc5, .scancode = 0x42 },
156
157     /* F9 */
158     { .keysym = 0xffc6, .scancode = 0x43 },
159
160     /* F10 */
161     { .keysym = 0xffc7, .scancode = 0x44 },
162
163     /* F11 */
164     { .keysym = 0xffc8, .scancode = 0x57 },
165
166     /* F12 */
167     { .keysym = 0xffc9, .scancode = 0x58 },
168
169     /* Shift_L */
170     { .keysym = 0xffe1, .scancode = 0x2A },
171
172     /* Shift_R */
173     { .keysym = 0xffe2, .scancode = 0x36 },
174
175     /* Control_L */
176     { .keysym = 0xffe3, .scancode = 0x1D },
177
178     /* Control_R */
179     { .keysym = 0xffe4, .scancode = 0x1D },
180
181     /* Caps_Lock */
182     { .keysym = 0xffe5, .scancode = 0x3A,
183         .flags = KBD_FLAGS_EXTENDED },
184
185     /* Alt_L */
186     { .keysym = 0xffe9, .scancode = 0x38 },
187
188     /* Alt_R */
189     { .keysym = 0xffea, .scancode = 0x38 },
190
191     /* Super_L */
192     { .keysym = 0xffeb, .scancode = 0x5B,
193         .flags = KBD_FLAGS_EXTENDED },
194
195     /* Super_R */
196     { .keysym = 0xffec, .scancode = 0x5C,
197         .flags = KBD_FLAGS_EXTENDED },
198
199     /* Delete */
200     { .keysym = 0xffff, .scancode = 0x53,
201         .flags = KBD_FLAGS_EXTENDED },
202
203     {0}
204
205 };
206
207 const guac_rdp_keymap guac_rdp_keymap_base = {
208
209     .name = "base",
210
211     .parent = NULL,
212     .mapping = __guac_rdp_keymap_mapping
213
214 };
215