20 #include <freerdp/config.h>
22 #include "xkb_layout_ids.h"
26 #include <winpr/crt.h>
28 #include <freerdp/locale/keyboard.h>
30 #include "liblocale.h"
35 UINT32 keyboardLayoutID;
41 UINT32 keyboardLayoutID;
42 const XKB_VARIANT* variants;
48 static const XKB_VARIANT us_variants[] = {
51 {
"intl", KBD_UNITED_STATES_INTERNATIONAL },
53 KBD_UNITED_STATES_INTERNATIONAL },
55 {
"dvorak", KBD_UNITED_STATES_DVORAK },
56 {
"dvorak-intl", KBD_UNITED_STATES_DVORAK },
57 {
"dvorak-l", KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND },
58 {
"dvorak-r", KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND },
59 {
"dvorak-classic", KBD_UNITED_STATES_DVORAK },
60 {
"dvp", KBD_UNITED_STATES_DVORAK_PROGRAMMER },
63 {
"altgr-intl", KBD_UNITED_STATES_INTERNATIONAL },
69 static const XKB_VARIANT af_variants[] = {
71 {
"uz", KBD_UZBEK_CYRILLIC },
72 {
"olpc-ps", KBD_PASHTO },
74 {
"olpc-uz", KBD_UZBEK_CYRILLIC },
79 static const XKB_VARIANT ara_variants[] = {
80 {
"azerty", KBD_ARABIC_102_AZERTY },
81 {
"azerty_digits", KBD_ARABIC_102_AZERTY },
82 {
"digits", KBD_ARABIC_102_AZERTY },
83 {
"qwerty", KBD_ARABIC_101 },
84 {
"qwerty_digits", KBD_ARABIC_101 },
85 {
"buckwalter", KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L },
90 static const XKB_VARIANT am_variants[] = {
92 {
"phonetic-alt", 0 },
93 {
"eastern", KBD_ARMENIAN_EASTERN },
94 {
"western", KBD_ARMENIAN_WESTERN },
95 {
"eastern-alt", KBD_ARMENIAN_EASTERN },
100 static const XKB_VARIANT az_variants[] = {
101 {
"cyrillic", KBD_AZERI_CYRILLIC },
106 static const XKB_VARIANT by_variants[] = {
107 {
"winkeys", KBD_BELARUSIAN },
108 {
"latin", KBD_BELARUSIAN },
113 static const XKB_VARIANT be_variants[] = {
114 {
"oss", KBD_BELGIAN_FRENCH },
115 {
"oss_latin9", KBD_BELGIAN_FRENCH },
116 {
"oss_sundeadkeys", KBD_BELGIAN_PERIOD },
117 {
"iso-alternate", KBD_BELGIAN_COMMA },
118 {
"nodeadkeys", KBD_BELGIAN_COMMA },
119 {
"sundeadkeys", KBD_BELGIAN_PERIOD },
120 {
"wang", KBD_BELGIAN_FRENCH },
125 static const XKB_VARIANT bd_variants[] = {
126 {
"probhat", KBD_BENGALI_INSCRIPT },
131 static const XKB_VARIANT in_variants[] = {
132 {
"ben", KBD_BENGALI },
133 {
"ben_probhat", KBD_BENGALI_INSCRIPT },
134 {
"guj", KBD_GUJARATI },
137 {
"kan", KBD_KANNADA },
138 {
"mal", KBD_MALAYALAM },
139 {
"mal_lalitha", KBD_MALAYALAM },
141 {
"tam_unicode", KBD_TAMIL },
142 {
"tam_TAB", KBD_TAMIL },
143 {
"tam_TSCII", KBD_TAMIL },
144 {
"tam", KBD_TAMIL },
145 {
"tel", KBD_TELUGU },
146 {
"urd-phonetic", KBD_URDU },
147 {
"urd-phonetic3", KBD_URDU },
148 {
"urd-winkeys", KBD_URDU },
149 {
"bolnagri", KBD_HINDI_TRADITIONAL },
150 {
"hin-wx", KBD_HINDI_TRADITIONAL },
155 static const XKB_VARIANT ba_variants[] = {
156 {
"alternatequotes", KBD_BOSNIAN },
157 {
"unicode", KBD_BOSNIAN },
158 {
"unicodeus", KBD_BOSNIAN },
159 {
"us", KBD_BOSNIAN_CYRILLIC },
164 static const XKB_VARIANT br_variants[] = {
165 {
"nodeadkeys", KBD_PORTUGUESE_BRAZILIAN_ABNT2 },
166 {
"dvorak", KBD_UNITED_STATES_DVORAK },
167 {
"nativo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 },
168 {
"nativo-us", KBD_PORTUGUESE_BRAZILIAN_ABNT2 },
169 {
"nativo-epo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 },
174 static const XKB_VARIANT bg_variants[] = {
175 {
"phonetic", KBD_BULGARIAN_LATIN },
176 {
"bas_phonetic", KBD_BULGARIAN_LATIN },
181 static const XKB_VARIANT ma_variants[] = {
182 {
"french", KBD_FRENCH },
184 {
"tifinagh-alt", 0 },
185 {
"tifinagh-alt-phonetic", 0 },
186 {
"tifinagh-extended", 0 },
187 {
"tifinagh-phonetic", 0 },
188 {
"tifinagh-extended-phonetic", 0 },
193 static const XKB_VARIANT ca_variants[] = {
194 {
"fr", KBD_CANADIAN_FRENCH },
195 {
"fr-dvorak", KBD_UNITED_STATES_DVORAK },
196 {
"fr-legacy", KBD_CANADIAN_FRENCH_LEGACY },
197 {
"multix", KBD_CANADIAN_MULTILINGUAL_STANDARD },
198 {
"multi", KBD_CANADIAN_MULTILINGUAL_STANDARD },
199 {
"multi-2gr", KBD_CANADIAN_MULTILINGUAL_STANDARD },
200 {
"ike", KBD_INUKTITUT_LATIN },
207 static const XKB_VARIANT cn_variants[] = {
209 {
"tib_asciinum", 0 },
214 static const XKB_VARIANT hr_variants[] = {
215 {
"alternatequotes", KBD_CROATIAN },
216 {
"unicode", KBD_CROATIAN },
217 {
"unicodeus", KBD_CROATIAN },
218 {
"us", KBD_CROATIAN },
223 static const XKB_VARIANT cz_variants[] = {
224 {
"bksl", KBD_CZECH_PROGRAMMERS },
225 {
"qwerty", KBD_CZECH_QWERTY },
226 {
"qwerty_bksl", KBD_CZECH_QWERTY },
227 {
"ucw", KBD_CZECH },
232 static const XKB_VARIANT dk_variants[] = {
233 {
"nodeadkeys", KBD_DANISH },
234 {
"mac", KBD_DANISH },
235 {
"mac_nodeadkeys", KBD_DANISH },
236 {
"dvorak", KBD_UNITED_STATES_DVORAK },
241 static const XKB_VARIANT nl_variants[] = {
242 {
"sundeadkeys", KBD_SWISS_FRENCH },
243 {
"mac", KBD_SWISS_FRENCH },
244 {
"std", KBD_SWISS_FRENCH },
249 static const XKB_VARIANT ee_variants[] = {
250 {
"nodeadkeys", KBD_US },
251 {
"dvorak", KBD_UNITED_STATES_DVORAK },
252 {
"us", KBD_UNITED_STATES_INTERNATIONAL },
257 static const XKB_VARIANT ir_variants[] = {
269 static const XKB_VARIANT iq_variants[] = {
278 static const XKB_VARIANT fo_variants[] = {
284 static const XKB_VARIANT fi_variants[] = {
293 static const XKB_VARIANT fr_variants[] = {
295 {
"sundeadkeys", 0 },
298 {
"oss_nodeadkeys", 0 },
299 {
"oss_sundeadkeys", 0 },
301 {
"latin9_nodeadkeys", 0 },
302 {
"latin9_sundeadkeys", 0 },
303 {
"bepo", KBD_FRENCH_BEPO },
304 {
"bepo_latin9", 0 },
314 static const XKB_VARIANT gh_variants[] = {
325 static const XKB_VARIANT ge_variants[] = {
334 static const XKB_VARIANT de_variants[] = {
335 {
"deadacute", KBD_GERMAN },
336 {
"deadgraveacute", KBD_GERMAN },
337 {
"nodeadkeys", KBD_GERMAN },
338 {
"ro", KBD_GERMAN },
341 {
"dvorak", KBD_UNITED_STATES_DVORAK },
342 {
"sundeadkeys", KBD_GERMAN },
343 {
"neo", KBD_GERMAN_NEO },
344 {
"mac", KBD_GERMAN },
345 {
"mac_nodeadkeys", KBD_GERMAN },
346 {
"dsb", KBD_GERMAN },
347 {
"dsb_qwertz", KBD_GERMAN },
348 {
"qwerty", KBD_GERMAN_IBM },
353 static const XKB_VARIANT gr_variants[] = {
354 {
"simple", KBD_GREEK_220 },
355 {
"extended", KBD_GREEK_319 },
356 {
"nodeadkeys", KBD_GREEK_319 },
357 {
"polytonic", KBD_GREEK_POLYTONIC },
362 static const XKB_VARIANT hu_variants[] = {
363 {
"standard", KBD_HUNGARIAN_101_KEY },
364 {
"nodeadkeys", KBD_HUNGARIAN_101_KEY },
365 {
"qwerty", KBD_HUNGARIAN_101_KEY },
366 {
"101_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY },
367 {
"101_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY },
368 {
"101_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY },
369 {
"101_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY },
370 {
"101_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY },
371 {
"101_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY },
372 {
"101_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY },
373 {
"101_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY },
374 {
"102_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY },
375 {
"102_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY },
376 {
"102_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY },
377 {
"102_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY },
378 {
"102_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY },
379 {
"102_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY },
380 {
"102_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY },
381 {
"102_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY },
386 static const XKB_VARIANT is_variants[] = {
387 {
"Sundeadkeys", KBD_ICELANDIC },
388 {
"nodeadkeys", KBD_ICELANDIC },
389 {
"mac", KBD_ICELANDIC },
390 {
"dvorak", KBD_UNITED_STATES_DVORAK },
395 static const XKB_VARIANT il_variants[] = {
396 {
"lyx", KBD_HEBREW },
397 {
"phonetic", KBD_HEBREW },
398 {
"biblical", KBD_HEBREW },
403 static const XKB_VARIANT it_variants[] = {
404 {
"nodeadkeys", KBD_ITALIAN_142 },
405 {
"mac", KBD_ITALIAN },
406 {
"geo", KBD_GEORGIAN },
411 static const XKB_VARIANT jp_variants[] = {
412 {
"kana", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 },
413 {
"OADG109A", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 },
418 static const XKB_VARIANT kg_variants[] = {
419 {
"phonetic", KBD_KYRGYZ_CYRILLIC },
424 static const XKB_VARIANT kz_variants[] = {
425 {
"ruskaz", KBD_KAZAKH },
426 {
"kazrus", KBD_KAZAKH },
431 static const XKB_VARIANT latam_variants[] = {
432 {
"nodeadkeys", KBD_LATIN_AMERICAN },
433 {
"deadtilde", KBD_LATIN_AMERICAN },
434 {
"sundeadkeys", KBD_LATIN_AMERICAN },
439 static const XKB_VARIANT lt_variants[] = {
440 {
"std", KBD_LITHUANIAN },
441 {
"us", KBD_LITHUANIAN_IBM },
442 {
"ibm", KBD_LITHUANIAN_IBM },
443 {
"lekp", KBD_LITHUANIAN },
444 {
"lekpa", KBD_LITHUANIAN },
445 {
"balticplus", KBD_LITHUANIAN },
450 static const XKB_VARIANT lv_variants[] = {
451 {
"apostrophe", KBD_LATVIAN },
452 {
"tilde", KBD_LATVIAN },
453 {
"fkey", KBD_LATVIAN },
458 static const XKB_VARIANT me_variants[] = {
461 {
"latinunicode", 0 },
463 {
"latinunicodeyz", 0 },
464 {
"cyrillicalternatequotes", 0 },
465 {
"latinalternatequotes", 0 },
470 static const XKB_VARIANT mk_variants[] = {
471 {
"nodeadkeys", KBD_FYRO_MACEDONIAN },
476 static const XKB_VARIANT mt_variants[] = {
477 {
"us", KBD_MALTESE_48_KEY },
482 static const XKB_VARIANT no_variants[] = {
483 {
"nodeadkeys", KBD_NORWEGIAN },
484 {
"dvorak", KBD_UNITED_STATES_DVORAK },
485 {
"smi", KBD_NORWEGIAN_WITH_SAMI },
486 {
"smi_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY },
487 {
"mac", KBD_NORWEGIAN },
488 {
"mac_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY },
493 static const XKB_VARIANT pl_variants[] = {
494 {
"qwertz", KBD_POLISH_214 },
495 {
"dvorak", KBD_UNITED_STATES_DVORAK },
496 {
"dvorak_quotes", KBD_UNITED_STATES_DVORAK },
497 {
"dvorak_altquotes", KBD_UNITED_STATES_DVORAK },
499 {
"ru_phonetic_dvorak", KBD_UNITED_STATES_DVORAK },
504 static const XKB_VARIANT pt_variants[] = {
505 {
"nodeadkeys", KBD_PORTUGUESE },
506 {
"sundeadkeys", KBD_PORTUGUESE },
507 {
"mac", KBD_PORTUGUESE },
508 {
"mac_nodeadkeys", KBD_PORTUGUESE },
509 {
"mac_sundeadkeys", KBD_PORTUGUESE },
510 {
"nativo", KBD_PORTUGUESE },
511 {
"nativo-us", KBD_PORTUGUESE },
512 {
"nativo-epo", KBD_PORTUGUESE },
517 static const XKB_VARIANT ro_variants[] = {
518 {
"cedilla", KBD_ROMANIAN },
519 {
"std", KBD_ROMANIAN },
520 {
"std_cedilla", KBD_ROMANIAN },
521 {
"winkeys", KBD_ROMANIAN },
522 {
"crh_f", KBD_TURKISH_F },
523 {
"crh_alt", KBD_TURKISH_Q },
524 {
"crh_dobruca1", KBD_TATAR },
525 {
"crh_dobruca2", KBD_TATAR },
530 static const XKB_VARIANT ru_variants[] = {
531 {
"phonetic", KBD_RUSSIAN },
532 {
"phonetic_winkeys", KBD_RUSSIAN },
533 {
"typewriter", KBD_RUSSIAN_TYPEWRITER },
534 {
"legacy", KBD_RUSSIAN },
549 static const XKB_VARIANT rs_variants[] = {
550 {
"yz", KBD_SERBIAN_CYRILLIC },
551 {
"latin", KBD_SERBIAN_LATIN },
552 {
"latinunicode", KBD_SERBIAN_LATIN },
553 {
"latinyz", KBD_SERBIAN_LATIN },
554 {
"latinunicodeyz", KBD_SERBIAN_LATIN },
555 {
"alternatequotes", KBD_SERBIAN_CYRILLIC },
556 {
"latinalternatequotes", KBD_SERBIAN_LATIN },
561 static const XKB_VARIANT si_variants[] = {
562 {
"alternatequotes", KBD_SLOVENIAN },
563 {
"us", KBD_UNITED_STATES_INTERNATIONAL },
568 static const XKB_VARIANT sk_variants[] = {
569 {
"bksl", KBD_SLOVAK },
570 {
"qwerty", KBD_SLOVAK_QWERTY },
571 {
"qwerty_bksl", KBD_SLOVAK_QWERTY },
576 static const XKB_VARIANT es_variants[] = {
577 {
"nodeadkeys", KBD_SPANISH_VARIATION },
578 {
"deadtilde", KBD_SPANISH_VARIATION },
579 {
"sundeadkeys", KBD_SPANISH },
580 {
"dvorak", KBD_UNITED_STATES_DVORAK },
581 {
"ast", KBD_SPANISH_VARIATION },
582 {
"cat", KBD_SPANISH_VARIATION },
583 {
"mac", KBD_SPANISH },
588 static const XKB_VARIANT se_variants[] = {
589 {
"nodeadkeys", KBD_SWEDISH },
590 {
"dvorak", KBD_UNITED_STATES_DVORAK },
591 {
"rus", KBD_RUSSIAN },
592 {
"rus_nodeadkeys", KBD_RUSSIAN },
593 {
"smi", KBD_SWEDISH_WITH_SAMI },
594 {
"mac", KBD_SWEDISH },
595 {
"svdvorak", KBD_UNITED_STATES_DVORAK },
600 static const XKB_VARIANT ch_variants[] = {
601 {
"de_nodeadkeys", KBD_SWISS_GERMAN },
602 {
"de_sundeadkeys", KBD_SWISS_GERMAN },
603 {
"fr", KBD_SWISS_FRENCH },
604 {
"fr_nodeadkeys", KBD_SWISS_FRENCH },
605 {
"fr_sundeadkeys", KBD_SWISS_FRENCH },
606 {
"fr_mac", KBD_SWISS_FRENCH },
607 {
"de_mac", KBD_SWISS_GERMAN },
612 static const XKB_VARIANT sy_variants[] = {
613 {
"syc", KBD_SYRIAC },
614 {
"syc_phonetic", KBD_SYRIAC_PHONETIC },
622 static const XKB_VARIANT tj_variants[] = {
628 static const XKB_VARIANT lk_variants[] = {
629 {
"tam_unicode", KBD_TAMIL },
630 {
"tam_TAB", KBD_TAMIL },
635 static const XKB_VARIANT th_variants[] = {
636 {
"tis", KBD_THAI_KEDMANEE_NON_SHIFTLOCK },
637 {
"pat", KBD_THAI_PATTACHOTE },
642 static const XKB_VARIANT tr_variants[] = {
643 {
"f", KBD_TURKISH_F },
644 {
"alt", KBD_TURKISH_Q },
645 {
"sundeadkeys", KBD_TURKISH_F },
649 {
"intl", KBD_TURKISH_F },
650 {
"crh", KBD_TATAR },
651 {
"crh_f", KBD_TURKISH_F },
652 {
"crh_alt", KBD_TURKISH_Q },
657 static const XKB_VARIANT ua_variants[] = {
658 {
"phonetic", KBD_UKRAINIAN },
659 {
"typewriter", KBD_UKRAINIAN },
660 {
"winkeys", KBD_UKRAINIAN },
661 {
"legacy", KBD_UKRAINIAN },
662 {
"rstu", KBD_UKRAINIAN },
663 {
"rstu_ru", KBD_UKRAINIAN },
664 {
"homophonic", KBD_UKRAINIAN },
665 {
"crh", KBD_TATAR },
666 {
"crh_f", KBD_TURKISH_F },
667 {
"crh_alt", KBD_TURKISH_Q },
672 static const XKB_VARIANT gb_variants[] = {
673 {
"extd", KBD_UNITED_KINGDOM_EXTENDED },
674 {
"intl", KBD_UNITED_KINGDOM_EXTENDED },
675 {
"dvorak", KBD_UNITED_STATES_DVORAK },
676 {
"dvorakukp", KBD_UNITED_STATES_DVORAK },
677 {
"mac", KBD_UNITED_KINGDOM },
683 static const XKB_VARIANT uz_variants[] = {
685 {
"crh", KBD_TATAR },
686 {
"crh_f", KBD_TURKISH_F },
687 {
"crh_alt", KBD_TURKISH_Q },
692 static const XKB_VARIANT kr_variants[] = {
693 {
"kr104", KBD_KOREAN_INPUT_SYSTEM_IME_2000 },
698 static const XKB_VARIANT ie_variants[] = {
699 {
"CloGaelach", KBD_GAELIC },
700 {
"UnicodeExpert", KBD_GAELIC },
701 {
"ogam", KBD_GAELIC },
702 {
"ogam_is434", KBD_GAELIC },
707 static const XKB_VARIANT pk_variants[] = {
710 {
"ara", KBD_ARABIC_101 },
715 static const XKB_VARIANT epo_variants[] = {
721 static const XKB_VARIANT ng_variants[] = {
729 static const XKB_VARIANT brai_variants[] = {
736 static const XKB_VARIANT tm_variants[] = {
737 {
"alt", KBD_TURKISH_Q },
741 static const XKB_LAYOUT xkbLayouts[] = {
742 {
"us", KBD_US, us_variants },
744 {
"af", KBD_FARSI, af_variants },
745 {
"ara", KBD_ARABIC_101, ara_variants },
747 {
"am", KBD_ARMENIAN_EASTERN, am_variants },
748 {
"az", KBD_AZERI_CYRILLIC, az_variants },
749 {
"by", KBD_BELARUSIAN, by_variants },
750 {
"be", KBD_BELGIAN_FRENCH, be_variants },
751 {
"bd", KBD_BENGALI, bd_variants },
752 {
"in", KBD_HINDI_TRADITIONAL, in_variants },
753 {
"ba", KBD_CROATIAN, ba_variants },
754 {
"br", KBD_PORTUGUESE_BRAZILIAN_ABNT, br_variants },
755 {
"bg", KBD_BULGARIAN_LATIN, bg_variants },
756 {
"ma", KBD_FRENCH, ma_variants },
758 {
"ca", KBD_US, ca_variants },
760 {
"cn", KBD_CHINESE_TRADITIONAL_PHONETIC, cn_variants },
761 {
"hr", KBD_CROATIAN, hr_variants },
762 {
"cz", KBD_CZECH, cz_variants },
763 {
"dk", KBD_DANISH, dk_variants },
764 {
"nl", KBD_DUTCH, nl_variants },
766 {
"ee", KBD_ESTONIAN, ee_variants },
767 {
"ir", 0, ir_variants },
768 {
"iq", 0, iq_variants },
769 {
"fo", 0, fo_variants },
770 {
"fi", KBD_FINNISH, fi_variants },
771 {
"fr", KBD_FRENCH, fr_variants },
772 {
"gh", 0, gh_variants },
774 {
"ge", KBD_GEORGIAN, ge_variants },
775 {
"at", KBD_GERMAN, de_variants },
776 {
"de", KBD_GERMAN, de_variants },
777 {
"gr", KBD_GREEK, gr_variants },
778 {
"hu", KBD_HUNGARIAN, hu_variants },
779 {
"is", KBD_ICELANDIC, is_variants },
780 {
"il", KBD_HEBREW, il_variants },
781 {
"it", KBD_ITALIAN, it_variants },
782 {
"jp", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, jp_variants },
783 {
"kg", 0, kg_variants },
785 {
"kz", KBD_KAZAKH, kz_variants },
787 {
"latam", KBD_LATIN_AMERICAN, latam_variants },
788 {
"lt", KBD_LITHUANIAN, lt_variants },
789 {
"lv", KBD_LATVIAN, lv_variants },
790 {
"mao", KBD_MAORI, NULL },
791 {
"me", KBD_SERBIAN_LATIN, me_variants },
792 {
"mk", KBD_FYRO_MACEDONIAN, mk_variants },
793 {
"mt", KBD_MALTESE_48_KEY, mt_variants },
794 {
"mn", KBD_MONGOLIAN_CYRILLIC, NULL },
795 {
"no", KBD_NORWEGIAN, no_variants },
796 {
"pl", KBD_POLISH_PROGRAMMERS, pl_variants },
797 {
"pt", KBD_PORTUGUESE, pt_variants },
798 {
"ro", KBD_ROMANIAN, ro_variants },
799 {
"ru", KBD_RUSSIAN, ru_variants },
800 {
"rs", KBD_SERBIAN_LATIN, rs_variants },
801 {
"si", KBD_SLOVENIAN, si_variants },
802 {
"sk", KBD_SLOVAK, sk_variants },
803 {
"es", KBD_SPANISH, es_variants },
804 {
"se", KBD_SWEDISH, se_variants },
805 {
"ch", KBD_SWISS_GERMAN, ch_variants },
806 {
"sy", KBD_SYRIAC, sy_variants },
807 {
"tj", 0, tj_variants },
808 {
"lk", 0, lk_variants },
809 {
"th", KBD_THAI_KEDMANEE, th_variants },
810 {
"tr", KBD_TURKISH_Q, tr_variants },
811 {
"ua", KBD_UKRAINIAN, ua_variants },
812 {
"gb", KBD_UNITED_KINGDOM, gb_variants },
813 {
"uz", KBD_UZBEK_CYRILLIC, uz_variants },
814 {
"vn", KBD_VIETNAMESE, NULL },
815 {
"kr", KBD_KOREAN_INPUT_SYSTEM_IME_2000, kr_variants },
816 {
"ie", KBD_UNITED_KINGDOM, ie_variants },
817 {
"pk", 0, pk_variants },
819 {
"za", KBD_US, NULL },
820 {
"epo", 0, epo_variants },
821 {
"np", KBD_NEPALI, NULL },
822 {
"ng", 0, ng_variants },
825 {
"brai", 0, brai_variants },
826 {
"tm", KBD_TURKISH_Q, tm_variants },
829 static UINT32 find_keyboard_layout_variant(
const XKB_LAYOUT* layout,
const char* variant)
831 WINPR_ASSERT(layout);
832 WINPR_ASSERT(variant);
834 const XKB_VARIANT* variants = layout->variants;
837 const XKB_VARIANT* var = variants;
838 while (var->variant && (strlen(var->variant) != 0))
840 if (strcmp(var->variant, variant) == 0)
841 return var->keyboardLayoutID;
846 return layout->keyboardLayoutID;
849 UINT32 find_keyboard_layout_in_xorg_rules(
const char* layout,
const char* variant)
851 if ((layout == NULL) || (variant == NULL))
854 DEBUG_KBD(
"xkbLayout: %s\txkbVariant: %s", layout, variant);
856 for (
size_t i = 0; i < ARRAYSIZE(xkbLayouts); i++)
858 const XKB_LAYOUT* cur = &xkbLayouts[i];
859 if (strcmp(cur->layout, layout) == 0)
860 return find_keyboard_layout_variant(cur, variant);