KEYMAP

From ArchWiki
Revision as of 23:52, 4 September 2012 by Palmaway (Talk | contribs) (Keyboard layouts: Changed table layout, corrected the singaporean one, other corrections)

Jump to: navigation, search

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="be-latin1.map.gz"
Brazilian Portuguese KEYMAP="br-abnt2.map.gz"
Canadian-French KEYMAP="cf.map.gz"
Canadian Multilingual (in AUR) KEYMAP="ca_multi.map.gz"
Colemak (US) KEYMAP="colemak"
Croatian KEYMAP="croat.map.gz"
Czech KEYMAP="cz-lat2.map.gz"
Dvorak KEYMAP="dvorak"
French KEYMAP="fr-latin9.map.gz"
German KEYMAP="de-latin1.map.gz"
German (no dead keys) KEYMAP="de-latin1-nodeadkeys.map.gz"
Italian KEYMAP="it.map.gz"
Lithuanian (qwerty) KEYMAP="lt.baltic.map.gz"
Norwegian KEYMAP="no-latin1.map.gz"
Polish KEYMAP="pl.map.gz"
Portuguese KEYMAP="pt-latin9.map.gz"
Romanian KEYMAP="ro_win.map.gz"
Russian KEYMAP="ru4.map.gz"
Singapore KEYMAP="sg-latin1.map.gz"
Slovene KEYMAP="slovene"
Swedish KEYMAP="sv-latin1.map.gz"
Swiss-French KEYMAP="fr_CH-latin1.map.gz"
Swiss-German KEYMAP="de_CH-latin1.map.gz"
Spanish KEYMAP="es.map.gz"
Spanish Latinoamerican KEYMAP="la-latin1.map.gz"
Turkish KEYMAP="tr_q-latin5.map.gz"
Ukrainian KEYMAP="ua.map.gz"
United Kingdom KEYMAP="uk"

Configuring the Console Keymap

  1. cd to /usr/share/kbd/keymaps/i386/qwerty
  2. Copy your default keymap (us.map.gz) to a new file personal.map.gz
  3. gunzip the new map file
  4. Edit personal.map 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
  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
Note: Prior to using /etc/vconsole.conf, KEYMAP=us was declared in /etc/rc.conf.