diff -uNr xc/programs/xkbcomp/keycodes/evdev xc-new/programs/xkbcomp/keycodes/evdev --- xc/programs/xkbcomp/keycodes/evdev 1970-01-01 03:00:00.000000000 +0300 +++ xc-new/programs/xkbcomp/keycodes/evdev 2006-01-23 03:21:12.000000000 +0300 @@ -0,0 +1,355 @@ +// translation from evdev scancodes to something resembling xfree86 keycodes. + +default xkb_keycodes "evdev" { + minimum = 8; + maximum = 255; + + = 49; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 51; + = 36; + + = 66; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + + = 50; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + + = 64; + = 37; + = 65; + = 105; + = 108; + // Microsoft keyboard extra keys + = 133; + = 134; + = 135; + + = 9; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 95; + = 96; + + = 107; + // = 107; + = 78; + = 127; + // = 419; + + = 118; + = 110; + = 112; + = 119; + = 115; + = 117; + + = 111; + = 113; + = 116; + = 114; + + = 77; + = 106; + = 63; + = 82; + + = 79; + = 80; + = 81; + = 86; + + = 83; + = 84; + = 85; + + = 87; + = 88; + = 89; + = 104; + + = 90; + = 91; + // = 126; + + = 191; + = 192; + = 193; + = 194; + = 195; + // = 123; + + // Keys that are generated on Japanese keyboards + + // alias = ; // Hankaku_Zenkaku toggle + // = 85; // Hankaku/Zenkakau toggle + // = 93; // Hiragana/Katakana toggle + // = 211; // backslash/underscore + // = 92; // Henkan + // = 94; // Muhenkan + // = 124; // Yen + + // Keys that are generated on Korean keyboards + + // alias = ; // Hangul Latin toggle + // alias = ; // Hangul to Hanja conversion + = 130; + = 131; + + // Extended keys that may be generated on "Internet" keyboards. + // These are not standardised, hence the meaningless names. + // The entries commented out are never generated because the raw codes + // in those positions are already used for well-defined keys. + + // evdev does standardize names for these though. comment them + // all out for now. + + // alias = ; + // = 130; + // alias = ; + // = 132; + // alias = ; + // = 134; + // = 135; + // = 136; + // = 137; + // = 138; + // = 139; + // = 140; + // = 141; + // = 142; + // = 143; + // = 144; + // = 145; + // = 146; + // = 147; + // = 148; + // = 149; + // = 150; + // = 151; + // = 152; + // = 153; + // = 154; + // = 155; + // = 156; + // = 157; + // = 158; + // = 159; + // = 160; + // = 161; + // = 162; + // = 163; + // = 164; + // = 165; + // = 166; + // = 167; + // = 168; + // = 169; + // = 170; + // = 171; + // = 172; + // = 173; + // = 174; + // = 175; + // = 176; + // = 177; + // = 178; + // = 179; + // = 180; + // = 181; + // = 182; + // = 183; + // = 184; + // = 185; + // = 186; + // = 187; + // = 188; + // = 189; + // = 190; + // = 191; + // = 192; + // = 193; + // = 194; + // = 195; + // = 196; + // = 197; + // = 198; + // = 199; + // = 200; + // = 201; + // = 202; + // = 203; + // = 204; + // = 205; + // = 206; + // = 207; + // = 208; + // = 209; + // = 210; + // = 211; + // = 212; + // = 213; + // = 214; + // = 215; + // = 216; + // = 217; + // = 218; + // = 219; + // = 220; + // = 221; + // = 222; + // = 223; + // = 224; + // = 225; + // = 226; + // = 227; + // = 228; + // = 229; + // = 230; + // = 231; + // = 232; + // = 233; + // = 234; + // = 235; + // = 236; + // = 237; + // = 238; + // = 239; + // = 240; + // = 241; + // = 242; + // = 243; + // = 244; + // = 245; + // = 246; + // = 247; + // = 248; + // = 249; + // = 250; + // = 251; + // = 252; + // = 253; + // = 254; + // = 255; + + // Codes generated for scancodes 0x59-0x5f, 0x62-0x76 + // = 157; // + // = 170; // + // = 181; // + // alias = ; + // = 182; // + // = 183; // + // = 184; // + // = 189; // + // = 190; // + // = 191; // + // = 192; // + // = 193; // + // = 198; // + // = 199; // + // = 200; // + // = 201; // + // = 203; // + // = 204; // + // = 205; // + // = 206; // + // = 207; // + // alias = ; // + // = 209; // + // = 210; // + // alias = ; // + // = 219; // + // = 220; // + // = 221; // + + // Solaris compatibility + + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + // alias = ; + + // Other codes never generated. The XFree86 ddx never generates + // these codes. + // Thus we can use them as fake keys + // = 93; // + // = 124; // + // = 125; // + // = 156; // + // = 127; // + // = 128; // + + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; + + alias = ; +}; diff -uNr xc/programs/xkbcomp/keycodes/Imakefile xc-new/programs/xkbcomp/keycodes/Imakefile --- xc/programs/xkbcomp/keycodes/Imakefile 2004-04-23 23:54:51.000000000 +0400 +++ xc-new/programs/xkbcomp/keycodes/Imakefile 2006-01-23 03:21:12.000000000 +0300 @@ -8,7 +8,7 @@ #define IHaveSubdirs DATAFILES = README amiga ataritt fujitsu hp ibm macintosh sony sun \ - xfree86 xfree98 powerpcps2 aliases + xfree86 xfree98 powerpcps2 aliases evdev SUBDIRS = digital sgi all:: diff -uNr xc/programs/xkbcomp/keymap/evdev xc-new/programs/xkbcomp/keymap/evdev --- xc/programs/xkbcomp/keymap/evdev 1970-01-01 03:00:00.000000000 +0300 +++ xc-new/programs/xkbcomp/keymap/evdev 2006-01-23 03:21:12.000000000 +0300 @@ -0,0 +1,362 @@ +// $XFree86: xc/programs/xkbcomp/keymap/evdev,v 3.30 2003/04/03 16:34:49 dawes Exp $ + + +default xkb_keymap "us" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc105)" }; + xkb_geometry { include "pc" }; +}; + +// "ar" addition by Arabeyes Team, +xkb_keymap "ar" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+ar" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "be" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+be" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "bg" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+bg" }; + xkb_geometry { include "pc(pc102)" }; +}; +// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) +xkb_keymap "br" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)+br" }; + xkb_geometry { include "pc(abnt2)" }; +}; +// cz and sk keymaps by Kamil Toman (ktoman@email.cz) +// are designed to replace old czechoslovakian and czsk keyboards +// and their prog variants. Those are now obsolete and should not be used anymore. +xkb_keymap "cz" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+cz" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "cz_qwerty" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+cz_qwerty" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "de" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+de" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "de_CH" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+de_CH" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "dk" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+dk" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "dvorak" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+dvorak" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "en_US" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "es" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+es" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+fr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr-latin9" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+fr-latin9" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "fr_CA" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+ca" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr_CH" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+fr_CH" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "gb" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+gb" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "hr" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+hr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "it" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+it" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "jp106" { + xkb_keycodes { include "evdev(jp106)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "jp(jp106)" }; + xkb_geometry { include "pc(jp106)" }; +}; +xkb_keymap "lt" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+lt" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "lt_std" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+lt_std" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "lv" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+lv" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mk" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+mk" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mt" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+mt" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mt_us" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+mt_us" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "no" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+no" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "pl" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+pl" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "pt" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+pt" }; + xkb_geometry { include "pc(pc102)" }; +}; +// ro: additions by Cristian Gafton, +xkb_keymap "ro" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc101)+ro(pc101)" }; + xkb_geometry { include "pc(pc101)" }; +}; +xkb_keymap "ro_microsoft" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+ro(pc105)" }; + xkb_geometry { include "pc(pc105)" }; +}; +xkb_keymap "ru" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+ru" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "se_FI" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+fi" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "se_SE" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+se" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "sl" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+si" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "sl_SI" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+si" }; + xkb_geometry { include "pc(pc102)" }; +}; +// cz and sk keymaps by Kamil Toman (ktoman@email.cz) +// are designed to replace old czechoslovakian and czsk keyboards +// and their prog variants. Those are now obsolete and should not be used anymore. +xkb_keymap "sk" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+sk" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "sk_qwerty" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+sk_qwerty" }; + xkb_geometry { include "pc" }; +}; +// Additions by Emil Soleyman-Zomalan, +xkb_keymap "syr" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+syr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+th" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th_tis" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+th_tis" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th_pat" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+th_pat" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "tr" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+tr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "uk" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+uk)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "us_flexpro" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc105)" }; + xkb_geometry { include "keytronic(FlexPro)" }; +}; +// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) +// us_intl means standard us keyboard plus dead_keys symbols +// these keyboards are very popular in Brazil +xkb_keymap "us_intl" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)+us_intl" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "us_microsoft" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc105)" }; + xkb_geometry { include "microsoft" }; +}; + +xkb_keymap "uz" { + xkb_keycodes { include "evdev" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc105)+uz" }; + xkb_geometry { include "pc(pc102)" }; +}; + diff -uNr xc/programs/xkbcomp/keymap/Imakefile xc-new/programs/xkbcomp/keymap/Imakefile --- xc/programs/xkbcomp/keymap/Imakefile 2004-04-23 23:54:52.000000000 +0400 +++ xc-new/programs/xkbcomp/keymap/Imakefile 2006-01-23 03:21:12.000000000 +0300 @@ -7,7 +7,7 @@ #define IHaveSubdirs - DATAFILES = README amiga ataritt macintosh sony xfree86 xfree98 + DATAFILES = README amiga ataritt macintosh sony xfree86 xfree98 evdev SUBDIRS = digital sgi sun all:: diff -uNr xc/programs/xkbcomp/rules/xorg xc-new/programs/xkbcomp/rules/xorg --- xc/programs/xkbcomp/rules/xorg 2005-08-12 14:50:44.000000000 +0400 +++ xc-new/programs/xkbcomp/rules/xorg 2006-01-23 03:21:12.000000000 +0300 @@ -52,6 +52,7 @@ pc98 = xfree98(pc98) abnt2 = xfree86(abnt2) jp106 = xfree86(jp106) + evdev = evdev * = xfree86 ! layout[1] = keycodes diff -uNr xc/programs/Xserver/hw/xfree86/input/evdev/evdev.c xc-new/programs/Xserver/hw/xfree86/input/evdev/evdev.c --- xc/programs/Xserver/hw/xfree86/input/evdev/evdev.c 2005-09-24 02:32:23.000000000 +0400 +++ xc-new/programs/Xserver/hw/xfree86/input/evdev/evdev.c 2006-01-23 20:10:08.000000000 +0300 @@ -47,6 +47,12 @@ #include #include +#ifdef XKB +#include +#include +#include +#endif + #include /* 2.4 compatibility */ @@ -81,8 +87,77 @@ typedef struct { int kernel24; + int noXkb; + + /* XKB stuff has to be per-device rather than per-driver */ +#ifdef XKB + char *xkb_rules; + char *xkb_model; + char *xkb_layout; + char *xkb_variant; + char *xkb_options; + XkbComponentNamesRec xkbnames; +#endif } EvdevRec, *EvdevPtr; +typedef enum { + OPTION_XKB_DISABLE, + OPTION_XKB_KEYMAP, + OPTION_XKB_KEYCODES, + OPTION_XKB_TYPES, + OPTION_XKB_COMPAT, + OPTION_XKB_SYMBOLS, + OPTION_XKB_GEOMETRY, + OPTION_XKB_RULES, + OPTION_XKB_MODEL, + OPTION_XKB_LAYOUT, + OPTION_XKB_VARIANT, + OPTION_XKB_OPTIONS +} EvdevOpts; + +#ifdef XFree86LOADER +static const OptionInfoRec EvdevOptions[] = { + { OPTION_XKB_DISABLE, "XkbDisable", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_XKB_KEYMAP, "XkbKeymap", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_KEYCODES, "XkbKeycodes", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_TYPES, "XkbTypes", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_COMPAT, "XkbCompat", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_SYMBOLS, "XkbSymbols", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_GEOMETRY, "XkbGeometry", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_RULES, "XkbRules", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_MODEL, "XkbModel", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_LAYOUT, "XkbLayout", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_VARIANT, "XkbVariant", OPTV_STRING, {0}, FALSE }, + { OPTION_XKB_OPTIONS, "XkbOptions", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } +}; +#endif + +static const char *evdevDefaults[] = { + "XkbRules", "xfree86", + "XkbModel", "evdev", + "XkbLayout", "us", + NULL +}; + +static void +SetXkbOption(InputInfoPtr pInfo, char *name, char **option) +{ + char *s; + + if ((s = xf86SetStrOption(pInfo->options, name, NULL))) { + if (!s[0]) { + xfree(s); + *option = NULL; + } else { + *option = s; + xf86Msg(X_CONFIG, "%s: %s: \"%s\"\n", pInfo->name, name, s); + } + } +} + +#define GET_EVDEVPTR(x) (x->public.devicePrivate->private) + static int wheel_up_button = 4; static int wheel_down_button = 5; static int wheel_left_button = 6; @@ -383,6 +458,7 @@ CARD8 modMap[MAP_LENGTH]; KeySym sym; int i, j; + EvdevPtr pEvdev; static struct { KeySym keysym; CARD8 mask; } modifiers[] = { { XK_Shift_L, ShiftMask }, @@ -404,6 +480,7 @@ */ pInfo = device->public.devicePrivate; + pEvdev = pInfo->private; /* Compute the modifier map */ memset(modMap, 0, sizeof modMap); @@ -421,14 +498,41 @@ keySyms.minKeyCode = MIN_KEYCODE; keySyms.maxKeyCode = MIN_KEYCODE + ArrayLength(map) / GLYPHS_PER_KEY - 1; - if (!InitKeyClassDeviceStruct(device, &keySyms, modMap)) - return !Success; - - if (!InitFocusClassDeviceStruct(device)) - return !Success; - - if (!InitKbdFeedbackClassDeviceStruct(device, EvdevKbdBell, EvdevKbdCtrl)) - return !Success; +#ifdef XKB + if (pEvdev->noXkb) +#endif + { + xf86Msg(X_CONFIG, "XKB: disabled\n"); + if (!InitKeyboardDeviceStruct((DevicePtr)device, &keySyms, modMap, + EvdevKbdBell, EvdevKbdCtrl)) + return !Success; + } +#ifdef XKB + else + { + SetXkbOption(pInfo, "XkbRules", &pEvdev->xkb_rules); + SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_model); + SetXkbOption(pInfo, "XkbLayout", &pEvdev->xkb_layout); + SetXkbOption(pInfo, "XkbVariant", &pEvdev->xkb_variant); + SetXkbOption(pInfo, "XkbOptions", &pEvdev->xkb_options); + SetXkbOption(pInfo, "XkbKeycodes", &pEvdev->xkbnames.keycodes); + SetXkbOption(pInfo, "XkbTypes", &pEvdev->xkbnames.types); + SetXkbOption(pInfo, "XkbCompat", &pEvdev->xkbnames.compat); + SetXkbOption(pInfo, "XkbSymbols", &pEvdev->xkbnames.symbols); + SetXkbOption(pInfo, "XkbGeometry", &pEvdev->xkbnames.geometry); + + if (pEvdev->xkbnames.keymap) + pEvdev->xkb_rules = NULL; + + XkbSetRulesDflts(pEvdev->xkb_rules, pEvdev->xkb_model, + pEvdev->xkb_layout, pEvdev->xkb_variant, + pEvdev->xkb_options); + if (!XkbInitKeyboardDeviceStruct(device, &pEvdev->xkbnames, + &keySyms, modMap, EvdevKbdBell, + EvdevKbdCtrl)) + return !Success; + } +#endif pInfo->flags |= XI86_KEYBOARD_CAPABLE; @@ -673,7 +777,12 @@ return pInfo; pInfo->private = pEvdev; - xf86CollectInputOptions(pInfo, NULL, NULL); + if (!(pEvdev = xcalloc(sizeof(EvdevRec), 1))) + return pInfo; + + pInfo->private = pEvdev; + + xf86CollectInputOptions(pInfo, evdevDefaults, NULL); xf86ProcessCommonOptions(pInfo, pInfo->options); device = xf86CheckStrOption(dev->commonOptions, "Device", NULL); @@ -695,6 +804,9 @@ return pInfo; } + pEvdev->noXkb = noXkbExtension; + /* parse the XKB options during kbd setup */ + if (EvdevProbe(pInfo)) xfree(pEvdev);