Search:  
Gentoo Wiki

X11_Keyboard

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Installation

Configuration

HIDevices

Fonts

Video Cards

OpenGL Compositing

Fonts

Monitors

edit
Note: If your using Xorg 7.3 (>=xorg-server-1.4) and newer, follow this guide.

Contents

Keyboard Layout

File: /etc/X11/xorg.conf
 Section "InputDevice"
  Identifier  "Generic Keyboard"
  Driver    "keyboard"
  Option    "CoreKeyboard"
  Option    "XkbRules"  "xorg"
  Option    "XkbModel"  "pc105"
# US, German, Dvorak
  Option    "XkbLayout" "us,de,dvorak"
# Switch layout with <ALT>+<SHIFT>
  Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
# watch out, the commas are important. Assign nodeadkeys to de
  Option "XkbVariant"  ",nodeadkeys,"
 EndSection

Keyboard Mappings

When you first convert over from pc105 to evdev as your keyboard driver, some keyboard mappings are probably going to go crazy. The first one I noticed was cursor key mappings were gone. This makes bash interesting. Here's how I fixed it; I got this solution from the fedora mailing lists.

File: /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keymap">
      <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>

    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.rules" type="string">xorg</merge>

      <!-- If we're using Linux, we use evdev by default (falling back to
           keyboard otherwise). -->
      <merge key="input.xkb.model" type="string">keyboard</merge>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux">
        <merge key="input.xkb.model" type="string">evdev</merge>
      </match>

      <merge key="input.xkb.layout" type="string">us</merge>
      <merge key="input.xkb.variant" type="string" />
    </match>
  </device>
</deviceinfo>
File: /etc/X11/xorg.conf
Section "InputDevice"
       Identifier      "Generic Keyboard"
       Option          "CoreKeyboard"
       Option          "XkbLayout"     "us"
       Option          "XkbModel"      "evdev"
       Option          "XkbRules"    "xorg"
       Option          "evBits"        "+1"
       Option          "keyBits"       "~1-255 ~352-511"
       Option          "Pass"  "3"
       Driver          "evdev"
EndSection

The input.xkb.rules needs to be changed from base to xorg. Then the keyboard seems to work properly. This causes all kinds of interesting problems if you try and use remote desktop solutions like nxclient. It's also recommended you modify your "InputDevice", but if you're using Hal this seems to be the right solution.

XkbOptions

Other XkbOptions (the same as in /usr/share/X11/xkb/rules/xorg.lst).

Which keys you can choose for switching between languages in /etc/X11/xorg.conf file:

  1. grp:switch — toggle using right alt key, but only until unpressed
  2. grp:lswitch — Left Alt key switches group while pressed
  3. grp:lwin_switch — Left Win-key switches group while pressed
  4. grp:rwin_switch — Right Win-key switches group while pressed
  5. grp:win_switch — Both Win-keys switch group while pressed
  6. grp:toggle — Right Alt key changes group
  7. grp:lalt_toggle — Left Alt key changes group
  8. grp:caps_toggle — Caps Lock key changes group
  9. grp:shift_caps_toggle — Shift+CapsLock changes group
  10. grp:shift_toggle — Both Shift keys together change group
  11. grp:alts_toggle — Both Alt keys together change group
  12. grp:ctrls_toggle — Both Ctrl keys together change group
  13. grp:ctrl_shift_toggle — Control+Shift changes group
  14. grp:ctrl_alt_toggle — Alt+Control changes group
  15. grp:alt_shift_toggle — Alt+Shift changes group
  16. grp:menu_toggle — toggle using "context menu" key on Windows keyboards
  17. grp:lwin_toggle — toggle using left win key on Windows keyboards
  18. grp:rwin_toggle — toggle using right win key on Windows keyboards
  19. grp:lshift_toggle — Left Shift key changes group
  20. grp:rshift_toggle — Right Shift key changes group
  21. grp:lctrl_toggle — Left Ctrl key changes group
  22. grp:rctrl_toggle — Right Ctrl key changes group


Possible signs using grp_led:

  1. grp_led — use keyboard leds to indicate group change
  2. grp_led:num — Num_Lock led indicates group change
  3. grp_led:caps — Caps_Lock led indicates group change
  4. grp_led:scroll — Scroll_Lock led indicates group change

if you have problems with setting up your keyboard, /etc/X11/xkb/README.config will be most helpful for you, so make sure to read that file

LinEAK

If someone has time - please put something about lineak here.

ebuilds of interest:

also check out the LinEAK project pages on sf

XOrg 6.9 or Greater, evdev, and USB Keyboards

The details for setting up evdev support for your kernel and X.org can be found here.

Logitech Cordless Desktop Pro

File: /etc/X11/xorg.conf
Section "InputDevice"
    Identifier      "Generic Keyboard"
    Option          "CoreKeyboard"
    Option          "XkbLayout"     "dk"

    Driver "evdev"
    Option "evBits"  "+1"
    Option "keyBits" "~1-255 ~352-511"
    Option "Pass"    "3"
EndSection


xmodmap

Now there's still the problem of howto map the X11-KeyCodes to actual keys, usable by your windowmanger. If you dont't want to install additional software, go the xmodmap way. You still have to map the generated keycodes to various functions/applications in your windowmanger(e.g. by using khotkeys for KDE). If you install xbindkeys you can assign applications to your keys in a non-windowmanger-specific way. You can even map shortcuts and mouse-events to your keys, if you use xte.

Retrieved from "http://www.gentoo-wiki.info/X11_Keyboard"

Last modified: Mon, 15 Sep 2008 08:26:00 +0000 Hits: 32,503