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)
(23 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Internationalization (English)]]
+
[[Category:Internationalization]]
{{i18n|KEYMAP}}
+
[[de:KEYMAP]]
The '''KEYMAP''' variable is specified in the {{ic|/etc/rc.conf}} file. It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the {{Pkg|kbd}} package.
+
[[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.
  
 
==Keyboard layouts==
 
==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.
+
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.
Most keymaps can be found in the {{ic|/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 {{ic|/usr/share/kbd/keymaps/''architecture''}} (''architecture''=mac, sun, etc.) directory.
 
Less common but nonetheless useful keymaps for Arch Linux are found in the {{ic|/usr/share/kbd/keymaps/''architecture''}} (''architecture''=mac, sun, etc.) directory.
Line 11: Line 16:
 
{{Note|In an X session, you can use setxkbmap to instantly apply keyboard layout: {{Ic|setxkbmap -layout dvorak}}}}
 
{{Note|In an X session, you can use setxkbmap to instantly apply keyboard layout: {{Ic|setxkbmap -layout dvorak}}}}
  
{{Note|If these keymaps do not work for you, try removing the {{Ic|.map.gz}} from the keymap name. If that does not work, 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]*"}}}}
+
{{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>{{Ic|KEYMAP<nowiki>=</nowiki>"be-latin1.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>be-latin1}}
<td>Belgian</td>
+
|-
</tr>
+
|Brazilian Portuguese
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>br-abnt2}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"br-abnt2.map.gz"}}</td>
+
|-
<td>Brazilian Portuguese</td>
+
|Canadian-French
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>cf}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"cf.map.gz"}}</td>
+
|Canadian Multilingual (''in [[Arch User Repository|AUR]]'')  
<td>Canadian-French</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ca_multi}}
</tr>
+
|-
<tr>
+
|Colemak ''(US)''
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"ca_multi.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>colemak}}
<td>Canadian Multilingual (''currently only available in the [[Arch User Repository|AUR]]'')</td>
+
|-
</tr>
+
|Croatian
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>croat}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"colemak"}}</td>
+
|-
<td>Colemak (US)</td>
+
|Czech
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>cz-lat2}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"croat.map.gz"}}</td>
+
|Dvorak
<td>Croatian</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>dvorak}}
</tr>
+
|-
<tr>
+
|Finnish
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"cz-lat2.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fi-latin1}}
<td>Czech</td>
+
|-
</tr>
+
|French
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fr-latin1}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"dvorak"}}</td>
+
|-
<td>Dvorak</td>
+
|German
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"fr-latin9.map.gz"}}</td>
+
|German ''(no dead keys)''
<td>French</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de-latin1-nodeadkeys}}
</tr>
+
|-
<tr>
+
|Italian
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"de-latin1.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>it}}
<td>German</td>
+
|-
</tr>
+
|Lithuanian ''(qwerty)''
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>lt.baltic}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"de-latin1-nodeadkeys.map.gz"}}</td>
+
|-
<td>German (no dead keys)</td>
+
|Norwegian
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>no-latin1}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"lt.baltic.map.gz"}}</td>
+
|Polish
<td>Lithuanian (qwerty)</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>pl}}
</tr>
+
|-
<tr>
+
|Portuguese
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"no-latin1.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>pt-latin9}}
<td>Norwegian</td>
+
|-
</tr>
+
|Romanian
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ro_win}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"lat2-16.psfu.gz"}}</td>
+
|-
<td>Polish</td>
+
|Russian
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ru4}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"pt-latin9.map.gz"}}</td>
+
|Singapore
<td>Portuguese</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>sg-latin1}}
</tr>
+
|-
<tr>
+
|Slovene
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"ro_win.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>slovene}}
<td>Romanian</td>
+
|-
</tr>
+
|Swedish
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>sv-latin1}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"ru4.map.gz"}}</td>
+
|-
<td>Russian</td>
+
|Swiss-French
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>fr_CH-latin1}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"slovene"}}</td>
+
|Swiss-German
<td>Slovene</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>de_CH-latin1}}
</tr>
+
|-
<tr>
+
|Spanish
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"sv-latin1.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>es}}
<td>Swedish</td>
+
|-
</tr>
+
|Spanish Latinoamerican
<tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>la-latin1}}
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"fr_CH-latin1.map.gz"}}</td>
+
|-
<td>Swiss-French</td>
+
|Turkish
</tr>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>tr_q-latin5}}
<tr>
+
|-
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"sg-latin1.map.gz"}}</td>
+
|Ukrainian
<td>Swiss-German</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>ua}}
</tr>
+
|-
<tr>
+
|United Kingdom
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"de_CH-latin1.map.gz"}}</td>
+
|{{Ic|KEYMAP<nowiki>=</nowiki>uk}}
<td>Swiss-German</td>
+
|}
</tr>
+
<tr>
+
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"es.map.gz"}}</td>
+
<td>Spanish</td>
+
</tr>
+
<tr>
+
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"la-latin1.map.gz"}}</td>
+
<td>Spanish Latinoamerican</td>
+
</tr>
+
<tr>
+
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"tr_q-latin5.map.gz"}}</td>
+
<td>Turkish</td>
+
</tr>
+
<tr>
+
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"ua.map.gz"}}</td>
+
<td>Ukrainian</td>
+
</tr>
+
<tr>
+
<td>{{Ic|KEYMAP<nowiki>=</nowiki>"uk"}}</td>
+
<td>United Kingdom</td>
+
</tr>
+
</table>
+
  
 +
==Configuring the Console Keymap==
  
 
+
#{{ic|cd}} to {{ic|/usr/share/kbd/keymaps/i386/qwerty}}
==Make CapsLock into another Control key in the Console==
+
#Copy your default keymap ({{ic|us.map.gz}}) to a new file {{ic|personal.map.gz}}
 
+
#{{ic|gunzip}} the new map file
<ol>
+
#Edit {{ic|personal.map}} using your favorite editor. Examples:
<li>{{ic|cd}} to {{ic|/usr/share/kbd/keymaps/i386/qwerty}}</li>
+
#*'''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"}}
<li>Copy the {{ic|us.map.gz}} to a new file {{ic|myus.map.gz}}</li>
+
#*'''Swap CapsLock with Escape (Vim)'''<br>make {{ic|keycode 1 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Escape}}
<li>{{ic|gunzip}} the new map file</li>
+
#*'''Make CapsLock another Control key'''<br>change the line {{ic|keycode 58 <nowiki>=</nowiki> Caps_Lock}} to {{ic|keycode 58 <nowiki>=</nowiki> Control}}
<li>Edit {{ic|myus.map}} using your favorite editor and change the line {{ic|keycode 58 <nowiki>=</nowiki> Caps_Lock}} to {{ic|keycode 58 <nowiki>=</nowiki> Control}}</li>
+
#*'''Swap CapsLock with Left Control key'''<br>make {{ic|keycode 29 <nowiki>=</nowiki> Caps_Lock}} and {{ic|keycode 58 <nowiki>=</nowiki> Control}}
<li>{{ic|gzip}} the map file</li>
+
#{{ic|gzip}} the map file
<li>Change the default keyboard layout file that will be used by editing {{ic|/etc/rc.conf}} and changing the line that says {{ic|KEYMAP<nowiki>=</nowiki>us}} to {{ic|KEYMAP<nowiki>=</nowiki>myus}}</li>
+
#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}}
<li>Reboot to use your capslock key the way nature intended</li>
+
#Reboot to use your keymap the way nature intended (or run "loadkeys personal")
</ol>
+

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")