Difference between revisions of "KEYMAP"

From ArchWiki
Jump to: navigation, search
m (KEYMAP=gb is invalid as there is no gb.map.gz file. Only KEYMAP=uk is correct)
(46 intermediate revisions by 30 users not shown)
Line 1: Line 1:
[[Category:Customizing (English)]]
+
[[Category:Internationalization]]
[[Category:Internationalization (English)]]
+
[[de:KEYMAP]]
[[Category:HOWTOs (English)]]
+
[[es:KEYMAP]]
 +
[[fr:KEYMAP]]
 +
[[ja:KEYMAP]]
 +
[[pt:KEYMAP]]
 +
[[tr:Klavye_düzeni]]
 +
[[zh-CN:KEYMAP]]
 +
The '''KEYMAP''' variable is specified in the [[Systemd#Console_and_keymap|{{ic|/etc/vconsole.conf}}]] file. It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the {{Pkg|kbd}} package.
  
== What is it ==
+
==Keyboard layouts==
 +
This is the list of known keymap settings to work for the corresponding keyboard layouts. Most keymaps can be found in the {{ic|/usr/share/kbd/keymaps/i386/''layout''}} (''layout''=qwerty, azerty, dvorak, etc.) directory.
  
The <code>KEYMAP</code> variable is specified in the <code>/etc/rc.conf</code> file. It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the kbd package.
+
Less common but nonetheless useful keymaps for Arch Linux are found in the {{ic|/usr/share/kbd/keymaps/''architecture''}} (''architecture''=mac, sun, etc.) directory.
  
== What can it be ==
+
{{Note|In an X session, you can use setxkbmap to instantly apply keyboard layout: {{Ic|setxkbmap -layout dvorak}}}}
This is the list of known keymap settings to work for the corresponding keyboard layouts. Usually the "map.gz" extension can be ignored.
+
The list of keymaps can be found in the /usr/share/kbd/keymaps/<arch> directory.
+
  
 +
{{Note|If these keymaps do not work for you, make sure the keymap file exists in {{ic|/usr/share/kbd/keymaps/}} using {{Ic|find}}: {{Ic|find /usr/share/kbd/keymaps/ -name "*[your desired keymap]*"}}}}
  
<table border="1" cellpadding="2" cellspacing="0">
+
{| class="wikitable" border="1"
<tr>
+
|-
<th>Keymap setting</th>
+
!  Keyboard
<th>Keyboard</th>
+
Keymap setting
</tr>
+
|-
<tr>
+
|Belgian
<td><code>KEYMAP="br-abnt2.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>be-latin1}}
<td>Brazilian Portuguese</td>
+
|-
</tr>
+
|Brazilian Portuguese
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>br-abnt2}}
<td><code>KEYMAP="cf.map.gz"</code></td>
+
|-
<td>Canadian-French</td>
+
|Canadian-French
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>cf}}
<tr>
+
|-
<td><code>KEYMAP="croat.map.gz"</code></td>
+
|Canadian Multilingual (''in [[Arch User Repository|AUR]]'')
<td>Croatian</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ca_multi}}
</tr>
+
|-
<tr>
+
|Colemak ''(US)''
<td><code>KEYMAP="cz-lat2.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>colemak}}
<td>Czech</td>
+
|-
</tr>
+
|Croatian
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>croat}}
<td><code>KEYMAP="fr-latin9.map.gz"</code></td>
+
|-
<td>French</td>
+
|Czech
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>cz-lat2}}
<tr>
+
|-
<td><code>KEYMAP="de-latin1.map.gz"</code></td>
+
|Dvorak
<td>German</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>dvorak}}
</tr>
+
|-
<tr>
+
|Finnish
<td><code>KEYMAP="de-latin1-nodeadkeys.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fi-latin1}}
<td>German (no dead keys)</td>
+
|-
</tr>
+
|French
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fr-latin1}}
<td><code>KEYMAP="lt.baltic.map.gz"</code></td>
+
|-
<td>Lithuanian (qwerty)</td>
+
|German
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1}}
<tr>
+
|-
<td><code>KEYMAP="no-latin1.map.gz"</code></td>
+
|German ''(no dead keys)''
<td>Norwegian</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1-nodeadkeys}}
</tr>
+
|-
<tr>
+
|Italian
<td><code>KEYMAP="lat2-16.psfu.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>it}}
<td>Polish</td>
+
|-
</tr>
+
|Lithuanian ''(qwerty)''
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>lt.baltic}}
<td><code>KEYMAP="pt-latin9.map.gz"</code></td>
+
|-
<td>Portuguese</td>
+
|Norwegian
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>no-latin1}}
<tr>
+
|-
<td><code>KEYMAP="ro_win.map.gz"</code></td>
+
|Polish
<td>Romanian</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>pl}}
</tr>
+
|-
<tr>
+
|Portuguese
<td><code>KEYMAP="ru4.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>pt-latin9}}
<td>Russian</td>
+
|-
</tr>
+
|Romanian
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ro_win}}
<td><code>KEYMAP="slovene"</code></td>
+
|-
<td>Slovene</td>
+
|Russian
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ru4}}
<tr>
+
|-
<td><code>KEYMAP="sv-latin1.map.gz"</code></td>
+
|Singapore
<td>Swedish</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>sg-latin1}}
</tr>
+
|-
<tr>
+
|Slovene
<td><code>KEYMAP="fr_CH-latin1.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>slovene}}
<td>Swiss-French</td>
+
|-
</tr>
+
|Swedish
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>sv-latin1}}
<td><code>KEYMAP="sg-latin1.map.gz"</code></td>
+
|-
<td>Swiss-German</td>
+
|Swiss-French
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fr_CH-latin1}}
<tr>
+
|-
<td><code>KEYMAP="de_CH-latin1.map.gz"</code></td>
+
|Swiss-German
<td>Swiss-German</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de_CH-latin1}}
</tr>
+
|-
<tr>
+
|Spanish
<td><code>KEYMAP="es.map.gz"</code></td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>es}}
<td>Spanish</td>
+
|-
</tr>
+
|Spanish Latinoamerican
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>la-latin1}}
<td><code>KEYMAP="tr_q-latin5.map.gz"</code></td>
+
|-
<td>Turkish</td>
+
|Turkish
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>tr_q-latin5}}
<tr>
+
|-
<td><code>KEYMAP="ua.map.gz"</code></td>
+
|Ukrainian
<td>Ukrainian</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ua}}
</tr>
+
|-
</table>
+
|United Kingdom
 +
|{{Ic|KEYMAP<nowiki>=</nowiki>uk}}
 +
|}
 +
 
 +
==Configuring the Console Keymap==
 +
 
 +
#{{ic|cd}} to {{ic|/usr/share/kbd/keymaps/i386/qwerty}}
 +
#Copy your default keymap ({{ic|us.map.gz}}) to a new file {{ic|personal.map.gz}}
 +
#{{ic|gunzip}} the new map file
 +
#Edit {{ic|personal.map}} using your favorite editor. Examples:
 +
#*'''Make the Right Alt key same as Left Alt key (Emacs)'''<br>change the line {{ic|include "linux-with-alt-and-altgr"}} to {{ic|include "linux-with-two-alt-keys"}}
 +
#*'''Swap CapsLock with Escape (Vim)'''<br>make {{ic|keycode 1 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Escape}}
 +
#*'''Make CapsLock another Control key'''<br>change the line {{ic|keycode 58 <nowiki>=</nowiki> Caps_Lock}} to {{ic|keycode 58 <nowiki>=</nowiki> Control}}
 +
#*'''Swap CapsLock with Left Control key'''<br>make {{ic|keycode 29 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Control}}
 +
#{{ic|gzip}} the map file
 +
#Change the default keyboard layout file that will be used by editing {{ic|/etc/vconsole.conf}} (you might have to create this file) and changing the line that says {{ic|KEYMAP<nowiki>=</nowiki>us}} to {{ic|KEYMAP<nowiki>=</nowiki>personal}}
 +
#Reboot to use your keymap the way nature intended (or run "loadkeys personal")

Revision as of 12:54, 28 December 2012

The KEYMAP variable is specified in the /etc/vconsole.conf file. 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. 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, 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
Brazilian Portuguese KEYMAP=br-abnt2
Canadian-French KEYMAP=cf
Canadian Multilingual (in AUR) KEYMAP=ca_multi
Colemak (US) KEYMAP=colemak
Croatian KEYMAP=croat
Czech KEYMAP=cz-lat2
Dvorak KEYMAP=dvorak
Finnish KEYMAP=fi-latin1
French KEYMAP=fr-latin1
German KEYMAP=de-latin1
German (no dead keys) KEYMAP=de-latin1-nodeadkeys
Italian KEYMAP=it
Lithuanian (qwerty) KEYMAP=lt.baltic
Norwegian KEYMAP=no-latin1
Polish KEYMAP=pl
Portuguese KEYMAP=pt-latin9
Romanian KEYMAP=ro_win
Russian KEYMAP=ru4
Singapore KEYMAP=sg-latin1
Slovene KEYMAP=slovene
Swedish KEYMAP=sv-latin1
Swiss-French KEYMAP=fr_CH-latin1
Swiss-German KEYMAP=de_CH-latin1
Spanish KEYMAP=es
Spanish Latinoamerican KEYMAP=la-latin1
Turkish KEYMAP=tr_q-latin5
Ukrainian KEYMAP=ua
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
    • 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")