1 /** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Keyboard Mapping 4 * 5 * Copyright 2009-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 #ifndef FREERDP_LOCALE_KEYBOARD_H 21 #define FREERDP_LOCALE_KEYBOARD_H 22 23 #include <winpr/input.h> 24 25 #include <freerdp/api.h> 26 #include <freerdp/types.h> 27 #include <freerdp/scancode.h> 28 29 #define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 30 #define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 31 #define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 32 33 struct _RDP_CODEPAGE 34 { 35 UINT16 id; 36 UINT8 primaryId; 37 UINT8 subId; 38 char locale[512]; 39 char primaryLanguage[512]; 40 char primaryLanguageSymbol[512]; 41 char subLanguage[512]; 42 char subLanguageSymbol[512]; 43 }; 44 typedef struct _RDP_CODEPAGE RDP_CODEPAGE; 45 46 struct _RDP_KEYBOARD_LAYOUT 47 { 48 DWORD code; /* Keyboard layout code */ 49 char* name; /* Keyboard layout name */ 50 }; 51 typedef struct _RDP_KEYBOARD_LAYOUT RDP_KEYBOARD_LAYOUT; 52 53 /* Keyboard layout IDs */ 54 55 #define KBD_ARABIC_101 0x00000401 56 #define KBD_BULGARIAN 0x00000402 57 #define KBD_CHINESE_TRADITIONAL_US 0x00000404 58 #define KBD_CZECH 0x00000405 59 #define KBD_DANISH 0x00000406 60 #define KBD_GERMAN 0x00000407 61 #define KBD_GREEK 0x00000408 62 #define KBD_US 0x00000409 63 #define KBD_SPANISH 0x0000040A 64 #define KBD_FINNISH 0x0000040B 65 #define KBD_FRENCH 0x0000040C 66 #define KBD_HEBREW 0x0000040D 67 #define KBD_HUNGARIAN 0x0000040E 68 #define KBD_ICELANDIC 0x0000040F 69 #define KBD_ITALIAN 0x00000410 70 #define KBD_JAPANESE 0x00000411 71 #define KBD_KOREAN 0x00000412 72 #define KBD_DUTCH 0x00000413 73 #define KBD_NORWEGIAN 0x00000414 74 #define KBD_POLISH_PROGRAMMERS 0x00000415 75 #define KBD_PORTUGUESE_BRAZILIAN_ABNT 0x00000416 76 #define KBD_ROMANIAN 0x00000418 77 #define KBD_RUSSIAN 0x00000419 78 #define KBD_CROATIAN 0x0000041A 79 #define KBD_SLOVAK 0x0000041B 80 #define KBD_ALBANIAN 0x0000041C 81 #define KBD_SWEDISH 0x0000041D 82 #define KBD_THAI_KEDMANEE 0x0000041E 83 #define KBD_TURKISH_Q 0x0000041F 84 #define KBD_URDU 0x00000420 85 #define KBD_UKRAINIAN 0x00000422 86 #define KBD_BELARUSIAN 0x00000423 87 #define KBD_SLOVENIAN 0x00000424 88 #define KBD_ESTONIAN 0x00000425 89 #define KBD_LATVIAN 0x00000426 90 #define KBD_LITHUANIAN_IBM 0x00000427 91 #define KBD_FARSI 0x00000429 92 #define KBD_VIETNAMESE 0x0000042A 93 #define KBD_ARMENIAN_EASTERN 0x0000042B 94 #define KBD_AZERI_LATIN 0x0000042C 95 #define KBD_FYRO_MACEDONIAN 0x0000042F 96 #define KBD_GEORGIAN 0x00000437 97 #define KBD_FAEROESE 0x00000438 98 #define KBD_DEVANAGARI_INSCRIPT 0x00000439 99 #define KBD_MALTESE_47_KEY 0x0000043A 100 #define KBD_NORWEGIAN_WITH_SAMI 0x0000043B 101 #define KBD_KAZAKH 0x0000043F 102 #define KBD_KYRGYZ_CYRILLIC 0x00000440 103 #define KBD_TATAR 0x00000444 104 #define KBD_BENGALI 0x00000445 105 #define KBD_PUNJABI 0x00000446 106 #define KBD_GUJARATI 0x00000447 107 #define KBD_TAMIL 0x00000449 108 #define KBD_TELUGU 0x0000044A 109 #define KBD_KANNADA 0x0000044B 110 #define KBD_MALAYALAM 0x0000044C 111 #define KBD_MARATHI 0x0000044E 112 #define KBD_MONGOLIAN_CYRILLIC 0x00000450 113 #define KBD_UNITED_KINGDOM_EXTENDED 0x00000452 114 #define KBD_SYRIAC 0x0000045A 115 #define KBD_NEPALI 0x00000461 116 #define KBD_PASHTO 0x00000463 117 #define KBD_DIVEHI_PHONETIC 0x00000465 118 #define KBD_LUXEMBOURGISH 0x0000046E 119 #define KBD_MAORI 0x00000481 120 #define KBD_CHINESE_SIMPLIFIED_US 0x00000804 121 #define KBD_SWISS_GERMAN 0x00000807 122 #define KBD_UNITED_KINGDOM 0x00000809 123 #define KBD_LATIN_AMERICAN 0x0000080A 124 #define KBD_BELGIAN_FRENCH 0x0000080C 125 #define KBD_BELGIAN_PERIOD 0x00000813 126 #define KBD_PORTUGUESE 0x00000816 127 #define KBD_SERBIAN_LATIN 0x0000081A 128 #define KBD_AZERI_CYRILLIC 0x0000082C 129 #define KBD_SWEDISH_WITH_SAMI 0x0000083B 130 #define KBD_UZBEK_CYRILLIC 0x00000843 131 #define KBD_INUKTITUT_LATIN 0x0000085D 132 #define KBD_CANADIAN_FRENCH_LEGACY 0x00000C0C 133 #define KBD_SERBIAN_CYRILLIC 0x00000C1A 134 #define KBD_CANADIAN_FRENCH 0x00001009 135 #define KBD_SWISS_FRENCH 0x0000100C 136 #define KBD_BOSNIAN 0x0000141A 137 #define KBD_IRISH 0x00001809 138 #define KBD_BOSNIAN_CYRILLIC 0x0000201A 139 140 /* Keyboard layout variant IDs */ 141 142 #define KBD_ARABIC_102 0x00010401 143 #define KBD_BULGARIAN_LATIN 0x00010402 144 #define KBD_CZECH_QWERTY 0x00010405 145 #define KBD_GERMAN_IBM 0x00010407 146 #define KBD_GREEK_220 0x00010408 147 #define KBD_UNITED_STATES_DVORAK 0x00010409 148 #define KBD_SPANISH_VARIATION 0x0001040A 149 #define KBD_HUNGARIAN_101_KEY 0x0001040E 150 #define KBD_ITALIAN_142 0x00010410 151 #define KBD_POLISH_214 0x00010415 152 #define KBD_PORTUGUESE_BRAZILIAN_ABNT2 0x00010416 153 #define KBD_RUSSIAN_TYPEWRITER 0x00010419 154 #define KBD_SLOVAK_QWERTY 0x0001041B 155 #define KBD_THAI_PATTACHOTE 0x0001041E 156 #define KBD_TURKISH_F 0x0001041F 157 #define KBD_LATVIAN_QWERTY 0x00010426 158 #define KBD_LITHUANIAN 0x00010427 159 #define KBD_ARMENIAN_WESTERN 0x0001042B 160 #define KBD_HINDI_TRADITIONAL 0x00010439 161 #define KBD_MALTESE_48_KEY 0x0001043A 162 #define KBD_SAMI_EXTENDED_NORWAY 0x0001043B 163 #define KBD_BENGALI_INSCRIPT 0x00010445 164 #define KBD_SYRIAC_PHONETIC 0x0001045A 165 #define KBD_DIVEHI_TYPEWRITER 0x00010465 166 #define KBD_BELGIAN_COMMA 0x0001080C 167 #define KBD_FINNISH_WITH_SAMI 0x0001083B 168 #define KBD_CANADIAN_MULTILINGUAL_STANDARD 0x00011009 169 #define KBD_GAELIC 0x00011809 170 #define KBD_ARABIC_102_AZERTY 0x00020401 171 #define KBD_CZECH_PROGRAMMERS 0x00020405 172 #define KBD_GREEK_319 0x00020408 173 #define KBD_UNITED_STATES_INTERNATIONAL 0x00020409 174 #define KBD_THAI_KEDMANEE_NON_SHIFTLOCK 0x0002041E 175 #define KBD_SAMI_EXTENDED_FINLAND_SWEDEN 0x0002083B 176 #define KBD_GREEK_220_LATIN 0x00030408 177 #define KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND 0x00030409 178 #define KBD_THAI_PATTACHOTE_NON_SHIFTLOCK 0x0003041E 179 #define KBD_GREEK_319_LATIN 0x00040408 180 #define KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND 0x00040409 181 #define KBD_UNITED_STATES_DVORAK_PROGRAMMER 0x19360409 182 #define KBD_GREEK_LATIN 0x00050408 183 #define KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L 0x00050409 184 #define KBD_GREEK_POLYTONIC 0x00060408 185 #define KBD_FRENCH_BEPO 0xa000040c 186 #define KBD_GERMAN_NEO 0xB0000407 187 188 /* Global Input Method Editor (IME) IDs */ 189 190 #define KBD_CHINESE_TRADITIONAL_PHONETIC 0xE0010404 191 #define KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 0xE0010411 192 #define KBD_KOREAN_INPUT_SYSTEM_IME_2000 0xE0010412 193 #define KBD_CHINESE_SIMPLIFIED_QUANPIN 0xE0010804 194 #define KBD_CHINESE_TRADITIONAL_CHANGJIE 0xE0020404 195 #define KBD_CHINESE_SIMPLIFIED_SHUANGPIN 0xE0020804 196 #define KBD_CHINESE_TRADITIONAL_QUICK 0xE0030404 197 #define KBD_CHINESE_SIMPLIFIED_ZHENGMA 0xE0030804 198 #define KBD_CHINESE_TRADITIONAL_BIG5_CODE 0xE0040404 199 #define KBD_CHINESE_TRADITIONAL_ARRAY 0xE0050404 200 #define KBD_CHINESE_SIMPLIFIED_NEIMA 0xE0050804 201 #define KBD_CHINESE_TRADITIONAL_DAYI 0xE0060404 202 #define KBD_CHINESE_TRADITIONAL_UNICODE 0xE0070404 203 #define KBD_CHINESE_TRADITIONAL_NEW_PHONETIC 0xE0080404 204 #define KBD_CHINESE_TRADITIONAL_NEW_CHANGJIE 0xE0090404 205 #define KBD_CHINESE_TRADITIONAL_MICROSOFT_PINYIN_IME_3 0xE00E0804 206 #define KBD_CHINESE_TRADITIONAL_ALPHANUMERIC 0xE00F0404 207 208 /* Keyboard Types */ 209 #define KBD_TYPE_IBM_PC_XT 0x00000001 /* IBM PC/XT or compatible (83-key) keyboard */ 210 #define KBD_TYPE_OLIVETTI_ICO 0x00000002 /* Olivetti "ICO" (102-key) keyboard */ 211 #define KBD_TYPE_IBM_PC_AT 0x00000003 /* IBM PC/AT (84-key) and similar keyboards */ 212 #define KBD_TYPE_IBM_ENHANCED 0x00000004 /* IBM enhanced (101-key or 102-key) keyboard */ 213 #define KBD_TYPE_NOKIA_1050 0x00000005 /* Nokia 1050 and similar keyboards */ 214 #define KBD_TYPE_NOKIA_9140 0x00000006 /* Nokia 9140 and similar keyboards */ 215 #define KBD_TYPE_JAPANESE 0x00000007 /* Japanese keyboard */ 216 217 #ifdef __cplusplus 218 extern "C" 219 { 220 #endif 221 222 FREERDP_API DWORD freerdp_keyboard_init(DWORD keyboardLayoutId); 223 FREERDP_API DWORD freerdp_keyboard_init_ex(DWORD keyboardLayoutId, 224 const char* keyboardRemappingList); 225 FREERDP_API RDP_KEYBOARD_LAYOUT* freerdp_keyboard_get_layouts(DWORD types); 226 FREERDP_API void freerdp_keyboard_layouts_free(RDP_KEYBOARD_LAYOUT* layouts); 227 FREERDP_API const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutId); 228 FREERDP_API DWORD freerdp_keyboard_get_layout_id_from_name(const char* name); 229 FREERDP_API DWORD freerdp_keyboard_get_rdp_scancode_from_x11_keycode(DWORD keycode); 230 FREERDP_API DWORD freerdp_keyboard_get_x11_keycode_from_rdp_scancode(DWORD scancode, 231 BOOL extended); 232 233 FREERDP_API RDP_CODEPAGE* 234 freerdp_keyboard_get_matching_codepages(DWORD column, const char* filter, size_t* count); 235 FREERDP_API void freerdp_codepages_free(RDP_CODEPAGE*); 236 237 #ifdef __cplusplus 238 } 239 #endif 240 241 #endif /* FREERDP_LOCALE_KEYBOARD_H */ 242