FreeRDP/libfreerdp-locale/keyboard_x11.c

978 lines
32 KiB
C
Raw Normal View History

2011-06-30 23:55:03 +04:00
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* X11 Keyboard Mapping
2011-06-30 23:55:03 +04:00
*
* Copyright 2009-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
2011-06-30 23:55:03 +04:00
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2012-02-19 07:04:28 +04:00
#include "liblocale.h"
#include <freerdp/locale/locale.h>
#include <freerdp/locale/keyboard.h>
2011-06-30 23:55:03 +04:00
2012-02-19 07:04:28 +04:00
#include "keyboard_x11.h"
2011-06-30 23:55:03 +04:00
extern uint32 RDP_SCANCODE_TO_X11_KEYCODE[256][2];
extern RDP_SCANCODE X11_KEYCODE_TO_RDP_SCANCODE[256];
2012-02-22 05:56:34 +04:00
extern const uint32 VIRTUAL_KEY_CODE_TO_RDP_SCANCODE_TABLE[256];
extern const RDP_SCANCODE VIRTUAL_KEY_CODE_TO_DEFAULT_RDP_SCANCODE_TABLE[256];
2012-02-19 07:04:28 +04:00
struct _XKB_VARIANT
2011-06-30 23:55:03 +04:00
{
2012-02-19 07:04:28 +04:00
const char* variant; /* XKB Keyboard layout variant */
uint32 keyboardLayoutID; /* Keyboard Layout ID */
};
typedef struct _XKB_VARIANT XKB_VARIANT;
2011-06-30 23:55:03 +04:00
2012-02-19 07:04:28 +04:00
struct _XKB_LAYOUT
2011-06-30 23:55:03 +04:00
{
2012-02-19 07:04:28 +04:00
const char* layout; /* XKB Keyboard layout */
uint32 keyboardLayoutID; /* Keyboard Layout ID */
const XKB_VARIANT* variants;
};
typedef struct _XKB_LAYOUT XKB_LAYOUT;
2011-06-30 23:55:03 +04:00
/* Those have been generated automatically and are waiting to be filled by hand */
/* USA */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT us_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "chr", 0 }, /* Cherokee */
{ "euro", 0 }, /* With EuroSign on 5 */
{ "intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (with dead keys) */
{ "alt-intl", KBD_UNITED_STATES_INTERNATIONAL }, /* Alternative international (former us_intl) */
{ "colemak", 0 }, /* Colemak */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "dvorak-intl", KBD_UNITED_STATES_DVORAK }, /* Dvorak international */
{ "dvorak-l", KBD_UNITED_STATES_DVORAK_FOR_LEFT_HAND }, /* Left handed Dvorak */
{ "dvorak-r", KBD_UNITED_STATES_DVORAK_FOR_RIGHT_HAND }, /* Right handed Dvorak */
{ "dvorak-classic", KBD_UNITED_STATES_DVORAK }, /* Classic Dvorak */
{ "dvp", KBD_UNITED_STATES_DVORAK }, /* Programmer Dvorak */
{ "rus", 0 }, /* Russian phonetic */
{ "mac", KBD_US }, /* Macintosh */
{ "altgr-intl", KBD_UNITED_STATES_INTERNATIONAL }, /* International (AltGr dead keys) */
{ "olpc2", KBD_US }, /* Group toggle on multiply/divide key */
{ "", 0 },
};
/* Afghanistan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT af_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "ps", KBD_PASHTO }, /* Pashto */
{ "uz", KBD_UZBEK_CYRILLIC }, /* Southern Uzbek */
{ "olpc-ps", KBD_PASHTO }, /* OLPC Pashto */
{ "olpc-fa", 0 }, /* OLPC Dari */
{ "olpc-uz", KBD_UZBEK_CYRILLIC }, /* OLPC Southern Uzbek */
{ "", 0 },
};
/* Arabic */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ara_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "azerty", KBD_ARABIC_102_AZERTY }, /* azerty */
{ "azerty_digits", KBD_ARABIC_102_AZERTY }, /* azerty/digits */
{ "digits", KBD_ARABIC_102_AZERTY }, /* digits */
{ "qwerty", KBD_ARABIC_101 }, /* qwerty */
{ "qwerty_digits", KBD_ARABIC_101 }, /* qwerty/digits */
{ "buckwalter", KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L }, /* Buckwalter */
{ "", 0 },
};
/* Armenia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT am_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "phonetic", 0 }, /* Phonetic */
{ "phonetic-alt", 0 }, /* Alternative Phonetic */
{ "eastern", KBD_ARMENIAN_EASTERN }, /* Eastern */
{ "western", KBD_ARMENIAN_WESTERN }, /* Western */
{ "eastern-alt", KBD_ARMENIAN_EASTERN }, /* Alternative Eastern */
{ "", 0 },
};
/* Azerbaijan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT az_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "cyrillic", KBD_AZERI_CYRILLIC }, /* Cyrillic */
{ "", 0 },
};
/* Belarus */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT by_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "winkeys", KBD_BELARUSIAN }, /* Winkeys */
{ "latin", KBD_BELARUSIAN }, /* Latin */
{ "", 0 },
};
/* Belgium */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT be_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "oss", KBD_BELGIAN_FRENCH }, /* Alternative */
{ "oss_latin9", KBD_BELGIAN_FRENCH }, /* Alternative, latin-9 only */
{ "oss_sundeadkeys", KBD_BELGIAN_PERIOD }, /* Alternative, Sun dead keys */
{ "iso-alternate", KBD_BELGIAN_COMMA }, /* ISO Alternate */
{ "nodeadkeys", KBD_BELGIAN_COMMA }, /* Eliminate dead keys */
{ "sundeadkeys", KBD_BELGIAN_PERIOD }, /* Sun dead keys */
{ "wang", KBD_BELGIAN_FRENCH }, /* Wang model 724 azerty */
{ "", 0 },
};
/* Bangladesh */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT bd_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "probhat", KBD_BENGALI_INSCRIPT }, /* Probhat */
{ "", 0 },
};
/* India */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT in_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "ben", KBD_BENGALI }, /* Bengali */
{ "ben_probhat", KBD_BENGALI_INSCRIPT }, /* Bengali Probhat */
{ "guj", KBD_GUJARATI }, /* Gujarati */
{ "guru", 0 }, /* Gurmukhi */
{ "jhelum", 0 }, /* Gurmukhi Jhelum */
{ "kan", KBD_KANNADA }, /* Kannada */
{ "mal", KBD_MALAYALAM }, /* Malayalam */
{ "mal_lalitha", KBD_MALAYALAM }, /* Malayalam Lalitha */
{ "ori", 0 }, /* Oriya */
{ "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */
{ "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */
{ "tam_TSCII", KBD_TAMIL }, /* Tamil TSCII Typewriter */
{ "tam", KBD_TAMIL }, /* Tamil */
{ "tel", KBD_TELUGU }, /* Telugu */
{ "urd-phonetic", KBD_URDU }, /* Urdu, Phonetic */
{ "urd-phonetic3", KBD_URDU }, /* Urdu, Alternative phonetic */
{ "urd-winkeys", KBD_URDU }, /* Urdu, Winkeys */
{ "bolnagri", KBD_HINDI_TRADITIONAL }, /* Hindi Bolnagri */
{ "hin-wx", KBD_HINDI_TRADITIONAL }, /* Hindi Wx */
{ "", 0 },
};
/* Bosnia and Herzegovina */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ba_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "alternatequotes", KBD_BOSNIAN }, /* Use guillemets for quotes */
{ "unicode", KBD_BOSNIAN }, /* Use Bosnian digraphs */
{ "unicodeus", KBD_BOSNIAN }, /* US keyboard with Bosnian digraphs */
{ "us", KBD_BOSNIAN_CYRILLIC }, /* US keyboard with Bosnian letters */
{ "", 0 },
};
/* Brazil */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT br_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "nativo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo */
{ "nativo-us", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for USA keyboards */
{ "nativo-epo", KBD_PORTUGUESE_BRAZILIAN_ABNT2 }, /* Nativo for Esperanto */
{ "", 0 },
};
/* Bulgaria */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT bg_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "phonetic", KBD_BULGARIAN_LATIN }, /* Traditional Phonetic */
{ "bas_phonetic", KBD_BULGARIAN_LATIN }, /* Standard Phonetic */
{ "", 0 },
};
/* Morocco */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ma_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "french", KBD_FRENCH }, /* French */
{ "tifinagh", 0 }, /* Tifinagh */
{ "tifinagh-alt", 0 }, /* Tifinagh Alternative */
{ "tifinagh-alt-phonetic", 0 }, /* Tifinagh Alternative Phonetic */
{ "tifinagh-extended", 0 }, /* Tifinagh Extended */
{ "tifinagh-phonetic", 0 }, /* Tifinagh Phonetic */
{ "tifinagh-extended-phonetic", 0 }, /* Tifinagh Extended Phonetic */
{ "", 0 },
};
/* Canada */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ca_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "fr-dvorak", KBD_UNITED_STATES_DVORAK }, /* French Dvorak */
{ "fr-legacy", KBD_CANADIAN_FRENCH }, /* French (legacy) */
{ "multix", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual */
{ "multi", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, first part */
{ "multi-2gr", KBD_CANADIAN_MULTILINGUAL_STANDARD }, /* Multilingual, second part */
{ "ike", KBD_INUKTITUT_LATIN }, /* Inuktitut */
{ "shs", 0 }, /* Secwepemctsin */
{ "kut", 0 }, /* Ktunaxa */
{ "eng", KBD_US }, /* English */
{ "", 0 },
};
/* China */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT cn_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "tib", 0 }, /* Tibetan */
{ "tib_asciinum", 0 }, /* Tibetan (with ASCII numerals) */
{ "", 0 },
};
/* Croatia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT hr_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "alternatequotes", KBD_CROATIAN }, /* Use guillemets for quotes */
{ "unicode", KBD_CROATIAN }, /* Use Croatian digraphs */
{ "unicodeus", KBD_CROATIAN }, /* US keyboard with Croatian digraphs */
{ "us", KBD_CROATIAN }, /* US keyboard with Croatian letters */
{ "", 0 },
};
/* Czechia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT cz_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "bksl", KBD_CZECH_PROGRAMMERS }, /* With &lt;\|&gt; key */
{ "qwerty", KBD_CZECH_QWERTY }, /* qwerty */
{ "qwerty_bksl", KBD_CZECH_QWERTY }, /* qwerty, extended Backslash */
{ "ucw", KBD_CZECH }, /* UCW layout (accented letters only) */
{ "", 0 },
};
/* Denmark */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT dk_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_DANISH }, /* Eliminate dead keys */
{ "mac", KBD_DANISH }, /* Macintosh */
{ "mac_nodeadkeys", KBD_DANISH }, /* Macintosh, eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "", 0 },
};
/* Netherlands */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT nl_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "sundeadkeys", KBD_SWISS_FRENCH }, /* Sun dead keys */
{ "mac", KBD_SWISS_FRENCH }, /* Macintosh */
{ "std", KBD_SWISS_FRENCH }, /* Standard */
{ "", 0 },
};
/* Estonia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ee_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_US }, /* Eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Estonian letters */
{ "", 0 },
};
/* Iran */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ir_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "pro", 0 }, /* Pro */
{ "keypad", 0 }, /* Keypad */
{ "pro_keypad", 0 }, /* Pro Keypad */
{ "ku", 0 }, /* Kurdish, Latin Q */
{ "ku_f", 0 }, /* Kurdish, (F) */
{ "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */
{ "ku_ara", 0 }, /* Kurdish, Arabic-Latin */
{ "", 0 },
};
/* Iraq */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT iq_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "ku", 0 }, /* Kurdish, Latin Q */
{ "ku_f", 0 }, /* Kurdish, (F) */
{ "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */
{ "ku_ara", 0 }, /* Kurdish, Arabic-Latin */
{ "", 0 },
};
/* Faroe Islands */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT fo_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", 0 }, /* Eliminate dead keys */
{ "", 0 },
};
/* Finland */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT fi_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", 0 }, /* Eliminate dead keys */
{ "smi", 0 }, /* Northern Saami */
{ "classic", 0 }, /* Classic */
{ "mac", 0 }, /* Macintosh */
{ "", 0 },
};
/* France */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT fr_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", 0 }, /* Eliminate dead keys */
{ "sundeadkeys", 0 }, /* Sun dead keys */
{ "oss", 0 }, /* Alternative */
{ "oss_latin9", 0 }, /* Alternative, latin-9 only */
{ "oss_nodeadkeys", 0 }, /* Alternative, eliminate dead keys */
{ "oss_sundeadkeys", 0 }, /* Alternative, Sun dead keys */
{ "latin9", 0 }, /* (Legacy) Alternative */
{ "latin9_nodeadkeys", 0 }, /* (Legacy) Alternative, eliminate dead keys */
{ "latin9_sundeadkeys", 0 }, /* (Legacy) Alternative, Sun dead keys */
{ "bepo", 0 }, /* Bepo, ergonomic, Dvorak way */
{ "bepo_latin9", 0 }, /* Bepo, ergonomic, Dvorak way, latin-9 only */
{ "dvorak", 0 }, /* Dvorak */
{ "mac", 0 }, /* Macintosh */
{ "bre", 0 }, /* Breton */
{ "oci", 0 }, /* Occitan */
{ "geo", 0 }, /* Georgian AZERTY Tskapo */
{ "", 0 },
};
/* Ghana */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT gh_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "generic", 0 }, /* Multilingual */
{ "akan", 0 }, /* Akan */
{ "ewe", 0 }, /* Ewe */
{ "fula", 0 }, /* Fula */
{ "ga", 0 }, /* Ga */
{ "hausa", 0 }, /* Hausa */
{ "", 0 },
};
/* Georgia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ge_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "ergonomic", 0 }, /* Ergonomic */
{ "mess", 0 }, /* MESS */
{ "ru", 0 }, /* Russian */
{ "os", 0 }, /* Ossetian */
{ "", 0 },
};
/* Germany */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT de_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "deadacute", KBD_GERMAN }, /* Dead acute */
{ "deadgraveacute", KBD_GERMAN }, /* Dead grave acute */
{ "nodeadkeys", KBD_GERMAN }, /* Eliminate dead keys */
{ "ro", KBD_GERMAN }, /* Romanian keyboard with German letters */
{ "ro_nodeadkeys", KBD_GERMAN }, /* Romanian keyboard with German letters, eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "sundeadkeys", KBD_GERMAN }, /* Sun dead keys */
{ "neo", KBD_GERMAN_NEO }, /* Neo 2 */
{ "mac", KBD_GERMAN }, /* Macintosh */
{ "mac_nodeadkeys", KBD_GERMAN }, /* Macintosh, eliminate dead keys */
{ "dsb", KBD_GERMAN }, /* Lower Sorbian */
{ "dsb_qwertz", KBD_GERMAN }, /* Lower Sorbian (qwertz) */
{ "qwerty", KBD_GERMAN_IBM }, /* qwerty */
{ "", 0 },
};
/* Greece */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT gr_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "simple", KBD_GREEK_220 }, /* Simple */
{ "extended", KBD_GREEK_319 }, /* Extended */
{ "nodeadkeys", KBD_GREEK_319}, /* Eliminate dead keys */
{ "polytonic", KBD_GREEK_POLYTONIC }, /* Polytonic */
{ "", 0 },
};
/* Hungary */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT hu_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "standard", KBD_HUNGARIAN_101_KEY }, /* Standard */
{ "nodeadkeys", KBD_HUNGARIAN_101_KEY }, /* Eliminate dead keys */
{ "qwerty", KBD_HUNGARIAN_101_KEY }, /* qwerty */
{ "101_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Dead keys */
{ "101_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/comma/Eliminate dead keys */
{ "101_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Dead keys */
{ "101_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwertz/dot/Eliminate dead keys */
{ "101_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Dead keys */
{ "101_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/comma/Eliminate dead keys */
{ "101_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Dead keys */
{ "101_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 101/qwerty/dot/Eliminate dead keys */
{ "102_qwertz_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Dead keys */
{ "102_qwertz_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/comma/Eliminate dead keys */
{ "102_qwertz_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Dead keys */
{ "102_qwertz_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwertz/dot/Eliminate dead keys */
{ "102_qwerty_comma_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Dead keys */
{ "102_qwerty_comma_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/comma/Eliminate dead keys */
{ "102_qwerty_dot_dead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Dead keys */
{ "102_qwerty_dot_nodead", KBD_HUNGARIAN_101_KEY }, /* 102/qwerty/dot/Eliminate dead keys */
{ "", 0 },
};
/* Iceland */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT is_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "Sundeadkeys", KBD_ICELANDIC }, /* Sun dead keys */
{ "nodeadkeys", KBD_ICELANDIC }, /* Eliminate dead keys */
{ "mac", KBD_ICELANDIC }, /* Macintosh */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "", 0 },
};
/* Israel */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT il_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "lyx", KBD_HEBREW }, /* lyx */
{ "phonetic", KBD_HEBREW }, /* Phonetic */
{ "biblical", KBD_HEBREW }, /* Biblical Hebrew (Tiro) */
{ "", 0 },
};
/* Italy */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT it_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_ITALIAN_142 }, /* Eliminate dead keys */
{ "mac", KBD_ITALIAN }, /* Macintosh */
{ "geo", KBD_GEORGIAN }, /* Georgian */
{ "", 0 },
};
/* Japan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT jp_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "kana", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* Kana */
{ "OADG109A", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002 }, /* OADG 109A */
{ "", 0 },
};
/* Kyrgyzstan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT kg_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "phonetic", KBD_KYRGYZ_CYRILLIC }, /* Phonetic */
{ "", 0 },
};
/* Kazakhstan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT kz_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "ruskaz", KBD_KAZAKH }, /* Russian with Kazakh */
{ "kazrus", KBD_KAZAKH }, /* Kazakh with Russian */
{ "", 0 },
};
/* Latin America */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT latam_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_LATIN_AMERICAN }, /* Eliminate dead keys */
{ "deadtilde", KBD_LATIN_AMERICAN }, /* Include dead tilde */
{ "sundeadkeys", KBD_LATIN_AMERICAN }, /* Sun dead keys */
{ "", 0 },
};
/* Lithuania */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT lt_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "std", KBD_LITHUANIAN }, /* Standard */
{ "us", KBD_LITHUANIAN_IBM }, /* US keyboard with Lithuanian letters */
{ "ibm", KBD_LITHUANIAN_IBM }, /* IBM (LST 1205-92) */
{ "lekp", KBD_LITHUANIAN }, /* LEKP */
{ "lekpa", KBD_LITHUANIAN }, /* LEKPa */
{ "balticplus", KBD_LITHUANIAN }, /* Baltic+ */
{ "", 0 },
};
/* Latvia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT lv_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "apostrophe", KBD_LATVIAN }, /* Apostrophe (') variant */
{ "tilde", KBD_LATVIAN }, /* Tilde (~) variant */
{ "fkey", KBD_LATVIAN }, /* F-letter (F) variant */
{ "", 0 },
};
/* Montenegro */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT me_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "cyrillic", 0 }, /* Cyrillic */
{ "cyrillicyz", 0 }, /* Cyrillic, Z and ZHE swapped */
{ "latinunicode", 0 }, /* Latin unicode */
{ "latinyz", 0 }, /* Latin qwerty */
{ "latinunicodeyz", 0 }, /* Latin unicode qwerty */
{ "cyrillicalternatequotes", 0 }, /* Cyrillic with guillemets */
{ "latinalternatequotes", 0 }, /* Latin with guillemets */
{ "", 0 },
};
/* Macedonia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT mk_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_FYRO_MACEDONIAN }, /* Eliminate dead keys */
{ "", 0 },
};
/* Malta */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT mt_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "us", KBD_MALTESE_48_KEY }, /* Maltese keyboard with US layout */
{ "", 0 },
};
/* Norway */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT no_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_NORWEGIAN }, /* Eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "smi", KBD_NORWEGIAN_WITH_SAMI }, /* Northern Saami */
{ "smi_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Northern Saami, eliminate dead keys */
{ "mac", KBD_NORWEGIAN }, /* Macintosh */
{ "mac_nodeadkeys", KBD_SAMI_EXTENDED_NORWAY }, /* Macintosh, eliminate dead keys */
{ "", 0 },
};
/* Poland */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT pl_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "qwertz", KBD_POLISH_214 }, /* qwertz */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "dvorak_quotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on quotemark key */
{ "dvorak_altquotes", KBD_UNITED_STATES_DVORAK }, /* Dvorak, Polish quotes on key 1 */
{ "csb", 0 }, /* Kashubian */
{ "ru_phonetic_dvorak", KBD_UNITED_STATES_DVORAK }, /* Russian phonetic Dvorak */
{ "", 0 },
};
/* Portugal */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT pt_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_PORTUGUESE }, /* Eliminate dead keys */
{ "sundeadkeys", KBD_PORTUGUESE }, /* Sun dead keys */
{ "mac", KBD_PORTUGUESE }, /* Macintosh */
{ "mac_nodeadkeys", KBD_PORTUGUESE }, /* Macintosh, eliminate dead keys */
{ "mac_sundeadkeys", KBD_PORTUGUESE }, /* Macintosh, Sun dead keys */
{ "nativo", KBD_PORTUGUESE }, /* Nativo */
{ "nativo-us", KBD_PORTUGUESE }, /* Nativo for USA keyboards */
{ "nativo-epo", KBD_PORTUGUESE }, /* Nativo for Esperanto */
{ "", 0 },
};
/* Romania */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ro_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "cedilla", KBD_ROMANIAN }, /* Cedilla */
{ "std", KBD_ROMANIAN }, /* Standard */
{ "std_cedilla", KBD_ROMANIAN }, /* Standard (Cedilla) */
{ "winkeys", KBD_ROMANIAN }, /* Winkeys */
{ "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */
{ "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */
{ "crh_dobruca1", KBD_TATAR }, /* Crimean Tatar (Dobruca-1 Q) */
{ "crh_dobruca2", KBD_TATAR }, /* Crimean Tatar (Dobruca-2 Q) */
{ "", 0 },
};
/* Russia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ru_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "phonetic", KBD_RUSSIAN }, /* Phonetic */
{ "phonetic_winkeys", KBD_RUSSIAN }, /* Phonetic Winkeys */
{ "typewriter", KBD_RUSSIAN_TYPEWRITER }, /* Typewriter */
{ "legacy", KBD_RUSSIAN }, /* Legacy */
{ "tt", KBD_TATAR }, /* Tatar */
{ "os_legacy", 0 }, /* Ossetian, legacy */
{ "os_winkeys", 0 }, /* Ossetian, Winkeys */
{ "cv", 0 }, /* Chuvash */
{ "cv_latin", 0 }, /* Chuvash Latin */
{ "udm", 0 }, /* Udmurt */
{ "kom", 0 }, /* Komi */
{ "sah", 0 }, /* Yakut */
{ "xal", 0 }, /* Kalmyk */
{ "dos", 0 }, /* DOS */
{ "", 0 },
};
/* Serbia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT rs_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "yz", KBD_SERBIAN_CYRILLIC }, /* Z and ZHE swapped */
{ "latin", KBD_SERBIAN_LATIN }, /* Latin */
{ "latinunicode", KBD_SERBIAN_LATIN }, /* Latin Unicode */
{ "latinyz", KBD_SERBIAN_LATIN }, /* Latin qwerty */
{ "latinunicodeyz", KBD_SERBIAN_LATIN }, /* Latin Unicode qwerty */
{ "alternatequotes", KBD_SERBIAN_CYRILLIC }, /* With guillemets */
{ "latinalternatequotes", KBD_SERBIAN_LATIN }, /* Latin with guillemets */
{ "", 0 },
};
/* Slovenia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT si_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "alternatequotes", KBD_SLOVENIAN }, /* Use guillemets for quotes */
{ "us", KBD_UNITED_STATES_INTERNATIONAL }, /* US keyboard with Slovenian letters */
{ "", 0 },
};
/* Slovakia */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT sk_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "bksl", KBD_SLOVAK }, /* Extended Backslash */
{ "qwerty", KBD_SLOVAK_QWERTY }, /* qwerty */
{ "qwerty_bksl", KBD_SLOVAK_QWERTY }, /* qwerty, extended Backslash */
{ "", 0 },
};
/* Spain */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT es_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_SPANISH_VARIATION }, /* Eliminate dead keys */
{ "deadtilde", KBD_SPANISH_VARIATION }, /* Include dead tilde */
{ "sundeadkeys", KBD_SPANISH }, /* Sun dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "ast", KBD_SPANISH_VARIATION }, /* Asturian variant with bottom-dot H and bottom-dot L */
{ "cat", KBD_SPANISH_VARIATION }, /* Catalan variant with middle-dot L */
{ "mac", KBD_SPANISH }, /* Macintosh */
{ "", 0 },
};
/* Sweden */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT se_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "nodeadkeys", KBD_SWEDISH }, /* Eliminate dead keys */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "rus", KBD_RUSSIAN }, /* Russian phonetic */
{ "rus_nodeadkeys", KBD_RUSSIAN }, /* Russian phonetic, eliminate dead keys */
{ "smi", KBD_SWEDISH_WITH_SAMI }, /* Northern Saami */
{ "mac", KBD_SWEDISH }, /* Macintosh */
{ "svdvorak", KBD_UNITED_STATES_DVORAK }, /* Svdvorak */
{ "", 0 },
};
/* Switzerland */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ch_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "de_nodeadkeys", KBD_SWISS_GERMAN }, /* German, eliminate dead keys */
{ "de_sundeadkeys", KBD_SWISS_GERMAN }, /* German, Sun dead keys */
{ "fr", KBD_SWISS_FRENCH }, /* French */
{ "fr_nodeadkeys", KBD_SWISS_FRENCH }, /* French, eliminate dead keys */
{ "fr_sundeadkeys", KBD_SWISS_FRENCH }, /* French, Sun dead keys */
{ "fr_mac", KBD_SWISS_FRENCH }, /* French (Macintosh) */
{ "de_mac", KBD_SWISS_GERMAN }, /* German (Macintosh) */
{ "", 0 },
};
/* Syria */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT sy_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "syc", KBD_SYRIAC }, /* Syriac */
{ "syc_phonetic", KBD_SYRIAC_PHONETIC }, /* Syriac phonetic */
{ "ku", 0 }, /* Kurdish, Latin Q */
{ "ku_f", 0 }, /* Kurdish, (F) */
{ "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */
{ "", 0 },
};
/* Tajikistan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT tj_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "legacy", 0 }, /* Legacy */
{ "", 0 },
};
/* Sri Lanka */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT lk_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "tam_unicode", KBD_TAMIL }, /* Tamil Unicode */
{ "tam_TAB", KBD_TAMIL }, /* Tamil TAB Typewriter */
{ "", 0 },
};
/* Thailand */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT th_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "tis", KBD_THAI_KEDMANEE_NON_SHIFTLOCK }, /* TIS-820.2538 */
{ "pat", KBD_THAI_PATTACHOTE }, /* Pattachote */
{ "", 0 },
};
/* Turkey */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT tr_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "f", KBD_TURKISH_F }, /* (F) */
{ "alt", KBD_TURKISH_Q }, /* Alt-Q */
{ "sundeadkeys", KBD_TURKISH_F }, /* Sun dead keys */
{ "ku", 0 }, /* Kurdish, Latin Q */
{ "ku_f", 0 }, /* Kurdish, (F) */
{ "ku_alt", 0 }, /* Kurdish, Latin Alt-Q */
{ "intl", KBD_TURKISH_F }, /* International (with dead keys) */
{ "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */
{ "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */
{ "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */
{ "", 0 },
};
/* Ukraine */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ua_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "phonetic", KBD_UKRAINIAN }, /* Phonetic */
{ "typewriter", KBD_UKRAINIAN }, /* Typewriter */
{ "winkeys", KBD_UKRAINIAN }, /* Winkeys */
{ "legacy", KBD_UKRAINIAN }, /* Legacy */
{ "rstu", KBD_UKRAINIAN }, /* Standard RSTU */
{ "rstu_ru", KBD_UKRAINIAN }, /* Standard RSTU on Russian layout */
{ "homophonic", KBD_UKRAINIAN }, /* Homophonic */
{ "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */
{ "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */
{ "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */
{ "", 0 },
};
/* United Kingdom */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT gb_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "extd", KBD_UNITED_KINGDOM_EXTENDED }, /* Extended - Winkeys */
{ "intl", KBD_UNITED_KINGDOM_EXTENDED }, /* International (with dead keys) */
{ "dvorak", KBD_UNITED_STATES_DVORAK }, /* Dvorak */
{ "dvorakukp", KBD_UNITED_STATES_DVORAK }, /* Dvorak (UK Punctuation) */
{ "mac", KBD_UNITED_KINGDOM }, /* Macintosh */
{ "colemak", 0 }, /* Colemak */
{ "", 0 },
};
/* Uzbekistan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT uz_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "latin", 0 }, /* Latin */
{ "crh", KBD_TATAR }, /* Crimean Tatar (Turkish Q) */
{ "crh_f", KBD_TURKISH_F }, /* Crimean Tatar (Turkish F) */
{ "crh_alt", KBD_TURKISH_Q }, /* Crimean Tatar (Turkish Alt-Q) */
{ "", 0 },
};
/* Korea, Republic of */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT kr_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "kr104", KBD_KOREAN_INPUT_SYSTEM_IME_2000 }, /* 101/104 key Compatible */
{ "", 0 },
};
/* Ireland */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ie_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "CloGaelach", KBD_GAELIC }, /* CloGaelach */
{ "UnicodeExpert", KBD_GAELIC }, /* UnicodeExpert */
{ "ogam", KBD_GAELIC }, /* Ogham */
{ "ogam_is434", KBD_GAELIC }, /* Ogham IS434 */
{ "", 0 },
};
/* Pakistan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT pk_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "urd-crulp", 0 }, /* CRULP */
{ "urd-nla", 0 }, /* NLA */
{ "ara", KBD_ARABIC_101 }, /* Arabic */
{ "", 0 },
};
/* Esperanto */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT epo_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "legacy", 0 }, /* displaced semicolon and quote (obsolete) */
{ "", 0 },
};
/* Nigeria */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT ng_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "igbo", 0 }, /* Igbo */
{ "yoruba", 0 }, /* Yoruba */
{ "hausa", 0 }, /* Hausa */
{ "", 0 },
};
/* Braille */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT brai_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "left_hand", 0 }, /* Left hand */
{ "right_hand", 0 }, /* Right hand */
{ "", 0 },
};
/* Turkmenistan */
2012-02-19 07:04:28 +04:00
static const XKB_VARIANT tm_variants[] =
2011-06-30 23:55:03 +04:00
{
{ "alt", KBD_TURKISH_Q }, /* Alt-Q */
{ "", 0 },
};
2012-02-19 07:04:28 +04:00
static const XKB_LAYOUT xkbLayouts[] =
2011-06-30 23:55:03 +04:00
{
{ "us", KBD_US, us_variants }, /* USA */
{ "ad", 0, NULL }, /* Andorra */
{ "af", KBD_FARSI, af_variants }, /* Afghanistan */
{ "ara", KBD_ARABIC_101, ara_variants }, /* Arabic */
{ "al", 0, NULL }, /* Albania */
{ "am", KBD_ARMENIAN_EASTERN, am_variants }, /* Armenia */
{ "az", KBD_AZERI_CYRILLIC, az_variants }, /* Azerbaijan */
{ "by", KBD_BELARUSIAN, by_variants }, /* Belarus */
{ "be", KBD_BELGIAN_FRENCH, be_variants }, /* Belgium */
{ "bd", KBD_BENGALI, bd_variants }, /* Bangladesh */
{ "in", KBD_HINDI_TRADITIONAL, in_variants }, /* India */
{ "ba", KBD_CROATIAN, ba_variants }, /* Bosnia and Herzegovina */
{ "br", KBD_PORTUGUESE_BRAZILIAN_ABNT, br_variants }, /* Brazil */
{ "bg", KBD_BULGARIAN_LATIN, bg_variants }, /* Bulgaria */
{ "ma", KBD_FRENCH, ma_variants }, /* Morocco */
{ "mm", 0, NULL }, /* Myanmar */
{ "ca", KBD_US, ca_variants }, /* Canada */
{ "cd", 0, NULL }, /* Congo, Democratic Republic of the */
{ "cn", KBD_CHINESE_TRADITIONAL_PHONETIC, cn_variants }, /* China */
{ "hr", KBD_CROATIAN, hr_variants }, /* Croatia */
{ "cz", KBD_CZECH, cz_variants }, /* Czechia */
{ "dk", KBD_DANISH, dk_variants }, /* Denmark */
{ "nl", KBD_DUTCH, nl_variants }, /* Netherlands */
{ "bt", 0, NULL }, /* Bhutan */
{ "ee", KBD_ESTONIAN, ee_variants }, /* Estonia */
{ "ir", 0, ir_variants }, /* Iran */
{ "iq", 0, iq_variants }, /* Iraq */
{ "fo", 0, fo_variants }, /* Faroe Islands */
{ "fi", KBD_FINNISH, fi_variants }, /* Finland */
{ "fr", KBD_FRENCH, fr_variants }, /* France */
{ "gh", 0, gh_variants }, /* Ghana */
{ "gn", 0, NULL }, /* Guinea */
{ "ge", KBD_GEORGIAN, ge_variants }, /* Georgia */
{ "de", KBD_GERMAN, de_variants }, /* Germany */
{ "gr", KBD_GREEK, gr_variants }, /* Greece */
{ "hu", KBD_HUNGARIAN, hu_variants }, /* Hungary */
{ "is", KBD_ICELANDIC, is_variants }, /* Iceland */
{ "il", KBD_HEBREW, il_variants }, /* Israel */
{ "it", KBD_ITALIAN, it_variants }, /* Italy */
{ "jp", KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, jp_variants }, /* Japan */
{ "kg", 0, kg_variants }, /* Kyrgyzstan */
{ "kh", 0, NULL }, /* Cambodia */
{ "kz", KBD_KAZAKH, kz_variants }, /* Kazakhstan */
{ "la", 0, NULL }, /* Laos */
{ "latam", KBD_LATIN_AMERICAN, latam_variants }, /* Latin America */
{ "lt", KBD_LITHUANIAN, lt_variants }, /* Lithuania */
{ "lv", KBD_LATVIAN, lv_variants }, /* Latvia */
{ "mao", KBD_MAORI, NULL }, /* Maori */
{ "me", KBD_SERBIAN_LATIN, me_variants }, /* Montenegro */
{ "mk", KBD_FYRO_MACEDONIAN, mk_variants }, /* Macedonia */
{ "mt", KBD_MALTESE_48_KEY, mt_variants }, /* Malta */
{ "mn", KBD_MONGOLIAN_CYRILLIC, NULL }, /* Mongolia */
{ "no", KBD_NORWEGIAN, no_variants }, /* Norway */
{ "pl", KBD_POLISH_214, pl_variants }, /* Poland */
{ "pt", KBD_PORTUGUESE, pt_variants }, /* Portugal */
{ "ro", KBD_ROMANIAN, ro_variants }, /* Romania */
{ "ru", KBD_RUSSIAN, ru_variants }, /* Russia */
{ "rs", KBD_SERBIAN_LATIN, rs_variants }, /* Serbia */
{ "si", KBD_SLOVENIAN, si_variants }, /* Slovenia */
{ "sk", KBD_SLOVAK, sk_variants }, /* Slovakia */
{ "es", KBD_SPANISH, es_variants }, /* Spain */
{ "se", KBD_SWEDISH, se_variants }, /* Sweden */
{ "ch", KBD_SWISS_FRENCH, ch_variants }, /* Switzerland */
{ "sy", KBD_SYRIAC, sy_variants }, /* Syria */
{ "tj", 0, tj_variants }, /* Tajikistan */
{ "lk", 0, lk_variants }, /* Sri Lanka */
{ "th", KBD_THAI_KEDMANEE, th_variants }, /* Thailand */
{ "tr", KBD_TURKISH_Q, tr_variants }, /* Turkey */
{ "ua", KBD_UKRAINIAN, ua_variants }, /* Ukraine */
{ "gb", KBD_UNITED_KINGDOM, gb_variants }, /* United Kingdom */
{ "uz", KBD_UZBEK_CYRILLIC, uz_variants }, /* Uzbekistan */
{ "vn", KBD_VIETNAMESE, NULL }, /* Vietnam */
{ "kr", KBD_KOREAN_INPUT_SYSTEM_IME_2000, kr_variants }, /* Korea, Republic of */
{ "ie", KBD_UNITED_KINGDOM, ie_variants }, /* Ireland */
{ "pk", 0, pk_variants }, /* Pakistan */
{ "mv", 0, NULL }, /* Maldives */
{ "za", 0, NULL }, /* South Africa */
{ "epo", 0, epo_variants }, /* Esperanto */
{ "np", KBD_NEPALI, NULL }, /* Nepal */
{ "ng", 0, ng_variants }, /* Nigeria */
{ "et", 0, NULL }, /* Ethiopia */
{ "sn", 0, NULL }, /* Senegal */
{ "brai", 0, brai_variants }, /* Braille */
{ "tm", KBD_TURKISH_Q, tm_variants }, /* Turkmenistan */
};
uint32 freerdp_keyboard_init_x11(uint32 keyboardLayoutId)
{
uint32 vkcode;
uint32 keycode;
2012-02-22 05:56:34 +04:00
uint32 scancode;
boolean extended;
uint32 keycode_to_vkcode[256];
memset(keycode_to_vkcode, 0, sizeof(keycode_to_vkcode));
memset(X11_KEYCODE_TO_RDP_SCANCODE, 0, sizeof(X11_KEYCODE_TO_RDP_SCANCODE));
memset(RDP_SCANCODE_TO_X11_KEYCODE, 0, sizeof(RDP_SCANCODE_TO_X11_KEYCODE));
if (keyboardLayoutId == 0)
{
keyboardLayoutId = freerdp_detect_keyboard_layout_from_system_locale();
DEBUG_KBD("using keyboard layout: %X", keyboardLayoutId);
}
if (keyboardLayoutId == 0)
{
keyboardLayoutId = 0x0409;
DEBUG_KBD("using default keyboard layout: %X", keyboardLayoutId);
}
#ifdef __APPLE__
/* Apple X11 breaks XKB detection */
freerdp_keyboard_load_map(keycode_to_vkcode, "macosx(macosx)");
#endif
for (keycode = 0; keycode < 256; keycode++)
{
vkcode = keycode_to_vkcode[keycode];
if (!(vkcode > 0 && vkcode < 256))
continue;
2012-02-22 05:56:34 +04:00
scancode = VIRTUAL_KEY_CODE_TO_RDP_SCANCODE_TABLE[vkcode];
extended = VIRTUAL_KEY_CODE_TO_DEFAULT_RDP_SCANCODE_TABLE[vkcode].extended;
2012-02-22 05:56:34 +04:00
X11_KEYCODE_TO_RDP_SCANCODE[keycode].code = scancode;
X11_KEYCODE_TO_RDP_SCANCODE[keycode].extended = extended;
if (extended)
RDP_SCANCODE_TO_X11_KEYCODE[scancode][1] = keycode;
else
2012-02-22 05:56:34 +04:00
RDP_SCANCODE_TO_X11_KEYCODE[scancode][0] = keycode;
}
return keyboardLayoutId;
}
2012-02-19 07:04:28 +04:00
uint32 find_keyboard_layout_in_xorg_rules(char* layout, char* variant)
2011-06-30 23:55:03 +04:00
{
2012-02-19 07:04:28 +04:00
int i, j;
2011-06-30 23:55:03 +04:00
if ((layout == NULL) || (variant == NULL))
2011-06-30 23:55:03 +04:00
return 0;
DEBUG_KBD("xkbLayout: %s\txkbVariant: %s", layout, variant);
2011-06-30 23:55:03 +04:00
2012-02-19 07:04:28 +04:00
for (i = 0; i < sizeof(xkbLayouts) / sizeof(XKB_LAYOUT); i++)
2011-06-30 23:55:03 +04:00
{
if (strcmp(xkbLayouts[i].layout, layout) == 0)
{
for (j = 0; xkbLayouts[i].variants[j].variant != NULL && strlen(xkbLayouts[i].variants[j].variant) > 0; j++)
{
if (strcmp(xkbLayouts[i].variants[j].variant, variant) == 0)
{
return xkbLayouts[i].variants[j].keyboardLayoutID;
}
}
return xkbLayouts[i].keyboardLayoutID;
}
}
return 0;
}