From ArchWiki
Revision as of 16:05, 7 October 2012 by Equant (talk | contribs)
Jump to navigation Jump to search

zh-CN:KEYMAP The KEYMAP variable is specified in the /etc/vconsole.conf file (/etc/rc.conf using the legacy rc.conf format). It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the kbd package.

Keyboard layouts

This is the list of known keymap settings to work for the corresponding keyboard layouts. Usually the "map.gz" extension can be ignored. Most keymaps can be found in the /usr/share/kbd/keymaps/i386/layout (layout=qwerty, azerty, dvorak, etc.) directory.

Less common but nonetheless useful keymaps for Arch Linux are found in the /usr/share/kbd/keymaps/architecture (architecture=mac, sun, etc.) directory.

Note: In an X session, you can use setxkbmap to instantly apply keyboard layout: setxkbmap -layout dvorak
Note: If these keymaps do not work for you, try removing the .map.gz from the keymap name. If that does not work, make sure the keymap file exists in /usr/share/kbd/keymaps/ using find: find /usr/share/kbd/keymaps/ -name "*[your desired keymap]*"
Keyboard Keymap setting
Belgian KEYMAP=""
Brazilian Portuguese KEYMAP=""
Canadian-French KEYMAP=""
Canadian Multilingual (in AUR) KEYMAP=""
Colemak (US) KEYMAP="colemak"
Croatian KEYMAP=""
Czech KEYMAP=""
Dvorak KEYMAP="dvorak"
French KEYMAP=""
German KEYMAP=""
German (no dead keys) KEYMAP=""
Italian KEYMAP=""
Lithuanian (qwerty) KEYMAP=""
Norwegian KEYMAP=""
Polish KEYMAP=""
Portuguese KEYMAP=""
Romanian KEYMAP=""
Russian KEYMAP=""
Singapore KEYMAP=""
Slovene KEYMAP="slovene"
Swedish KEYMAP=""
Swiss-French KEYMAP=""
Swiss-German KEYMAP=""
Spanish KEYMAP=""
Spanish Latinoamerican KEYMAP=""
Turkish KEYMAP=""
Ukrainian KEYMAP=""
United Kingdom KEYMAP="uk"

Configuring the Console Keymap

  1. cd to /usr/share/kbd/keymaps/i386/qwerty
  2. Copy your default keymap ( to a new file
  3. gunzip the new map file
  4. Edit using your favorite editor. Examples:
    • Make the Right Alt key same as Left Alt key (Emacs)
      change the line include "linux-with-alt-and-altgr" to include "linux-with-two-alt-keys"
    • Swap CapsLock with Escape (Vim)
      make keycode 1 = Caps_Lock and keycode 58 = Escape
    • Make CapsLock another Control key
      change the line keycode 58 = Caps_Lock to keycode 58 = Control
    • Swap CapsLock with Left Control key
      make keycode 29 = Caps_Lock and keycode 58 = Control
  5. gzip the map file
  6. Change the default keyboard layout file that will be used by editing /etc/vconsole.conf (you might have to create this file) and changing the line that says KEYMAP=us to KEYMAP=personal
  7. Reboot to use your keymap the way nature intended (or run "loadkeys personal")
Note: Prior to using /etc/vconsole.conf, KEYMAP=us was declared in /etc/rc.conf.