From c158cf2b64034a49e1c95549603b684e21e7511a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 21 Jan 2009 16:32:27 +1100 Subject: Require XKB. Welcome to the future. Signed-off-by: Peter Hutterer --- src/evdev.c | 64 ++++++++++++++++++++++--------------------------------------- 1 file changed, 23 insertions(+), 41 deletions(-) (limited to 'src/evdev.c') diff --git a/src/evdev.c b/src/evdev.c index 463b32a..dc5f055 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -41,9 +41,7 @@ #include #include #include -#ifdef XKB #include -#endif #include "evdev.h" @@ -839,43 +837,29 @@ EvdevAddKeyClass(DeviceIntPtr device) keySyms.minKeyCode = MIN_KEYCODE; keySyms.maxKeyCode = MIN_KEYCODE + ArrayLength(map) / GLYPHS_PER_KEY - 1; -#ifdef XKB - if (pEvdev->noXkb) -#endif - { - xf86Msg(X_CONFIG, "XKB: disabled\n"); - if (!InitKeyboardDeviceStruct((DevicePtr)device, &keySyms, modMap, - NULL, EvdevKbdCtrl)) - return !Success; - } -#ifdef XKB - else - { - /* sorry, no rules change allowed for you */ - xf86ReplaceStrOption(pInfo->options, "xkb_rules", "evdev"); - SetXkbOption(pInfo, "xkb_rules", &pEvdev->xkb_rules); - SetXkbOption(pInfo, "xkb_model", &pEvdev->xkb_model); - if (!pEvdev->xkb_model) - SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_model); - SetXkbOption(pInfo, "xkb_layout", &pEvdev->xkb_layout); - if (!pEvdev->xkb_layout) - SetXkbOption(pInfo, "XkbLayout", &pEvdev->xkb_layout); - SetXkbOption(pInfo, "xkb_variant", &pEvdev->xkb_variant); - if (!pEvdev->xkb_variant) - SetXkbOption(pInfo, "XkbVariant", &pEvdev->xkb_variant); - SetXkbOption(pInfo, "xkb_options", &pEvdev->xkb_options); - if (!pEvdev->xkb_options) - SetXkbOption(pInfo, "XkbOptions", &pEvdev->xkb_options); - - XkbSetRulesDflts(pEvdev->xkb_rules, pEvdev->xkb_model, - pEvdev->xkb_layout, pEvdev->xkb_variant, - pEvdev->xkb_options); - if (!XkbInitKeyboardDeviceStruct(device, &pEvdev->xkbnames, - &keySyms, modMap, NULL, - EvdevKbdCtrl)) - return !Success; - } -#endif + /* sorry, no rules change allowed for you */ + xf86ReplaceStrOption(pInfo->options, "xkb_rules", "evdev"); + SetXkbOption(pInfo, "xkb_rules", &pEvdev->xkb_rules); + SetXkbOption(pInfo, "xkb_model", &pEvdev->xkb_model); + if (!pEvdev->xkb_model) + SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_model); + SetXkbOption(pInfo, "xkb_layout", &pEvdev->xkb_layout); + if (!pEvdev->xkb_layout) + SetXkbOption(pInfo, "XkbLayout", &pEvdev->xkb_layout); + SetXkbOption(pInfo, "xkb_variant", &pEvdev->xkb_variant); + if (!pEvdev->xkb_variant) + SetXkbOption(pInfo, "XkbVariant", &pEvdev->xkb_variant); + SetXkbOption(pInfo, "xkb_options", &pEvdev->xkb_options); + if (!pEvdev->xkb_options) + SetXkbOption(pInfo, "XkbOptions", &pEvdev->xkb_options); + + XkbSetRulesDflts(pEvdev->xkb_rules, pEvdev->xkb_model, + pEvdev->xkb_layout, pEvdev->xkb_variant, + pEvdev->xkb_options); + if (!XkbInitKeyboardDeviceStruct(device, &pEvdev->xkbnames, + &keySyms, modMap, NULL, + EvdevKbdCtrl)) + return !Success; pInfo->flags |= XI86_KEYBOARD_CAPABLE; @@ -1563,8 +1547,6 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags) Note that this needs a server that sets the console to RAW mode. */ pEvdev->grabDevice = xf86CheckBoolOption(dev->commonOptions, "GrabDevice", 0); - pEvdev->noXkb = noXkbExtension; /* parse the XKB options during kbd setup */ - EvdevInitButtonMapping(pInfo); if (EvdevProbe(pInfo)) { -- cgit v1.2.3