1056N/A<?
xml version="1.0" encoding="UTF-8"?>
1276N/A<
html xmlns="http://www.w3.org/1999/xhtml"><
head><
meta http-
equiv="Content-Type" content="text/html; charset=UTF-8" /><
title>The XKB Configuration Guide</
title><
meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_9276" /><
meta name="description" content="This document describes how to configure Xorg XKB from a user's point of view. It covers basic configuration syntax and gives also a few examples. This version covers Xorg server versions 1.8 and later, used with the data files from the xkeyboard-config project." /><
style xmlns="" type="text/css">/*
1276N/A * Copyright (c) 2011 Gaetan Nadon
1276N/A * Copyright (c) 2010, Oracle
and/
or its affiliates. All rights reserved.
1276N/A * Permission is hereby granted, free of charge, to any person obtaining a
1276N/A * copy of this software and associated documentation files (the "Software"),
1276N/A * to deal in the Software without restriction, including without limitation
1276N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1276N/A *
and/
or sell copies of the Software, and to permit persons to whom the
1276N/A * Software is furnished to do so, subject to the following conditions:
1276N/A * The above copyright notice and this permission notice (including the next
1276N/A * paragraph) shall be included in all copies or substantial portions of the
1276N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1276N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1276N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1276N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1276N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1276N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1276N/A * DEALINGS IN THE SOFTWARE.
1276N/A * Shared stylesheet for
X.Org documentation translated to HTML format
1276N/A * The sans-serif fonts are considered more legible on a computer screen
1276N/A font-family: "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif;
1276N/A /* In support of using "em" font size unit, the w3c recommended method */
1276N/A * Selection: all elements requiring mono spaced fonts.
1276N/A * The family names attempt to match the proportionally spaced font
1276N/A * family names such that the same font name is used for both.
1276N/A * We'd like to use Bitstream, for example, in both proportionally and
1276N/A font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Courier, "Liberation Mono", Monospace;
1276N/A * Books have a title page, a preface, some chapters and appendices,
1276N/A * a glossary, an index and a bibliography, in that order.
1276N/A * An Article has no preface and no chapters. It has sections, appendices,
1276N/A * a glossary, an index and a bibliography.
1276N/A * Selection: book main title and subtitle
1276N/A * Selection: article main title and subtitle
1276N/A * Selection: various types of authors and collaborators, individuals or corporate
1276N/A * These authors are not always contained inside an authorgroup.
1276N/A * They can be contained inside a lot of different parent types where they might
1276N/A * Reducing the margin at the bottom makes a visual separation between authors
1276N/A * We specify here the ones on the title page, others may be added based on merit.
1276N/A * Selection: the affiliation of various types of authors and collaborators,
1276N/A * individuals or corporate.
1276N/A * Selection: product release information (X Version 11, Release 7)
1276N/A * The releaseinfo element can be contained inside a lot of different parent
1276N/A * types where it might not be centered.
1276N/A * We specify here the one on the title page, others may be added based on merit.
1276N/A * Selection: publishing date
1276N/A * The legal notices are displayed in smaller sized fonts
1276N/A * Justification is only supported in IE and therefore not requested.
1276N/A * For documentation having multiple licenses, the copyright and legalnotice
1276N/A * elements sequence cannot instantiated multiple times.
1276N/A * The copyright notice and license text are therefore coded inside a legalnotice
1276N/A * element. The role attribute on the paragraph is used to allow styling of the
1276N/A * copyright notice text which should not be italicized.
1276N/A * Selection: book or article main ToC title
1276N/A * A paragraph is generated for the title rather than a level 2 heading.
1276N/A * We do not want to select chapters sub table of contents, only the main one
1276N/A * Selection: major sections of a book or an article
1276N/A * Unlike books, articles do not have a titlepage element for appendix.
1276N/A /* Add a border top over the major parts, just like printed books */
1276N/A /* The Gray color is already used for the ruler over the main ToC. */
1276N/A /* Put some space between the border and the title */
1276N/A * A Screen is a verbatim environment for displaying text that the user might
1276N/A * see on a computer terminal. It is often used to display the results of a command.
1276N/A /* Browser's vendor properties prior to CSS 3 */
1276N/A -webkit-border-radius: 1.0em;
1276N/A -khtml-border-radius: 1.0em;
1276N/A * Emphasis program listings with a light shade of gray similar to what
1276N/A * Found many C API docs on the web using like shades of gray.
1276N/A * Emphasis functions synopsis using a darker shade of gray.
1276N/A * Add a border such that it stands out more.
1276N/A * Set the padding so the text does not touch the border.
1276N/A * Selection: paragraphs inside synopsis
1276N/A * Removes the default browser margin, let the container set the padding.
1276N/A * Paragraphs are not always used in synopsis
1276N/A * Selection: variable lists, informal tables and tables
1276N/A * Set the left margin so it is indented to the right
1276N/A * Display informal tables with single line borders
1276N/A * Selection: paragraphs inside tables
1276N/A * Removes the default browser margin, let the container set the padding.
1276N/A * Paragraphs are not always used in tables
1276N/A * Add some space between the left and right column.
1276N/A * The vertical alignment helps the reader associate a term
1276N/A * with a multi-line definition.
1276N/A</
style></
head><
body><
div class="article"><
div class="titlepage"><
div><
div><
h2 class="title"><
a id="XKB-Config"></
a>The XKB Configuration Guide</
h2></
div><
div><
div class="authorgroup"><
div class="author"><
h3 class="author"><
span class="firstname">Kamil</
span> <
span class="surname">Toman</
span></
h3></
div><
div class="author"><
h3 class="author"><
span class="firstname">Ivan</
span> <
span class="othername">U.</
span> <
span class="surname">Pascal</
span></
h3></
div></
div></
div><
div><
p class="releaseinfo">X Version 11, Release 7.7</
p></
div><
div><
p class="pubdate">November 2010</
p></
div><
div><
div class="abstract"><
p>
1056N/AThis document describes how to configure Xorg XKB from a user's point
1056N/Aof view. It covers basic configuration syntax and gives also a few examples.
1056N/AThis version covers Xorg server versions 1.8 and later, used with the
1276N/A </
p></
div></
div></
div><
hr /></
div><
div class="toc"><
p><
strong>Table of Contents</
strong></
p><
dl><
dt><
span class="sect1"><
a href="#Overview">Overview</
a></
span></
dt><
dt><
span class="sect1"><
a href="#Selecting_XKB_Configuration">Selecting XKB Configuration</
a></
span></
dt><
dd><
dl><
dt><
span class="sect2"><
a href="#Basic_Configuration">Basic Configuration</
a></
span></
dt><
dt><
span class="sect2"><
a href="#Advanced_Configuration">Advanced Configuration</
a></
span></
dt><
dt><
span class="sect2"><
a href="#Even_More_Advanced_Configuration">Even More Advanced Configuration</
a></
span></
dt><
dt><
span class="sect2"><
a href="#Basic_Global_Options">Basic Global Options</
a></
span></
dt></
dl></
dd><
dt><
span class="sect1"><
a href="#Keymap_XKB_Configuration">Keymap XKB Configuration</
a></
span></
dt></
dl></
div><
div class="sect1"><
div class="titlepage"><
div><
div><
h2 class="title" style="clear: both"><
a id="Overview"></
a>Overview</
h2></
div></
div></
div><
p>
1056N/AThe XKB configuration is decomposed into a number of components. Selecting
1056N/Aproper parts and combining them back you can achieve most of the configurations
1056N/Ayou might need. Unless you have a completely atypical keyboard you really don't
1056N/Aneed to touch any of the xkb configuration files.
1056N/ASome desktop environments now provide integrated graphical configuration
1056N/Atools for setting XKB configuration as part of your desktop session. The
1056N/Ainstructions in this document are provided for those without such support,
1056N/Athose who need to configure XKB before the session startup (such as at the
1056N/Alogin screen), or those who need to perform more advanced configuration
1276N/A </
p></
div><
div class="sect1"><
div class="titlepage"><
div><
div><
h2 class="title" style="clear: both"><
a id="Selecting_XKB_Configuration"></
a>Selecting XKB Configuration</
h2></
div></
div></
div><
p>
1056N/AThe easiest and the most natural way to specify a keyboard mapping is to use
1056N/Athe <
code class="literal">rules</
code> component. As its name suggests it describes a number of
1056N/Ageneral rules to combine all bits and pieces into a valid and useful keyboard
1056N/Amapping. All you need to do is to select a suitable rules file and then to
1056N/Afeed it with a few parameters that will adjust the keyboard behaviour to
1276N/A </
p><
div class="variablelist"><
table border="0" class="variablelist"><
colgroup><
col align="left" valign="top" /></
colgroup><
tbody><
tr><
td><
p><
span class="term"><
code class="option">XkbRules</
code></
span></
p></
td><
td><
p>
1056N/Afiles of rules to be used for keyboard mapping composition
1276N/A </
p></
td></
tr><
tr><
td><
p><
span class="term"><
code class="option">XkbModel</
code></
span></
p></
td><
td><
p>
1056N/A name of the model of your keyboard type
1276N/A </
p></
td></
tr><
tr><
td><
p><
span class="term"><
code class="option">XkbLayout</
code></
span></
p></
td><
td><
p>
1056N/A layout(s) you intend to use
1276N/A </
p></
td></
tr><
tr><
td><
p><
span class="term"><
code class="option">XkbVariant</
code></
span></
p></
td><
td><
p>
1056N/A variant(s) of the layout you intend to use
1276N/A </
p></
td></
tr><
tr><
td><
p><
span class="term"><
code class="option">XkbOptions</
code></
span></
p></
td><
td><
p>
1056N/A extra xkb configuration options
1056N/A </
p></
td></
tr></
tbody></
table></
div><
p>
1056N/AThe rules file used depends on your system. The rules files commonly
1056N/AOn Linux systems, the <
code class="filename">evdev</
code> rules are most
1056N/Acommonly used, on other systems the <
code class="filename">base</
code> rules
1056N/Aare used. Some additional rules files exist for historical reasons,
1056N/Abut are no longer widely used. In general, it's best to simply not
1056N/Aspecify the rules file, in order to use the default rules selected
1056N/Aautomatically by the X server.
1056N/AFor each rules file there is a description file named
1056N/A<
code class="filename"><<
em class="replaceable"><
code>vendor-rules</
code></
em>>.lst</
code>,
1056N/Afor instance <
code class="filename">
base.lst</
code> which is located in
1056N/Athe xkb configuration subdirectory <
code class="filename">rules</
code>
1276N/A </
p><
div class="sect2"><
div class="titlepage"><
div><
div><
h3 class="title"><
a id="Basic_Configuration"></
a>Basic Configuration</
h3></
div></
div></
div><
p>
1056N/ALet's say you want to configure a PC-style American keyboard with 104
1056N/Akeys as described in <
code class="filename">
base.lst</
code>. This can be done
1056N/Aby simply writing several lines from below to a new configuration file
1056N/A Identifier "keyboard defaults"
1056N/AThe values of <
code class="option">XkbModel</
code> and <
code class="option">XkbLayout</
code> are
1056N/Areally not surprising. The <
code class="option">XkbOptions</
code>
1056N/Ahas been explicitly set to the empty set of parameters.
1056N/AThe <
code class="option">XkbVariant</
code> option has been left out.
1056N/AThat means the default variant named <
code class="literal">basic</
code>
1056N/AOf course, this can be also done at runtime using the utility
1276N/A<
span class="command"><
strong>setxkbmap</
strong></
span>.
1056N/AThe shell command loading the same keyboard mapping would look like:
1056N/Asetxkbmap -model pc104 -layout us -option ""
1056N/AThe configuration and the shell command would be very analogous
1056N/Afor most other layouts (internationalized mappings).
1276N/AIf you wanted to enable the <
span class="keycap"><
strong>Ctrl</
strong></
span>+<
span class="keycap"><
strong>Alt</
strong></
span>+<
span class="keycap"><
strong>Backspace</
strong></
span> sequence to kill
1056N/Athe X server by default, you could create a configuration snippet
1056N/A Identifier "keyboard defaults"
1056N/A Option "XKbOptions" "terminate:ctrl_alt_bksp"
1056N/AThis would be equivalent to running the shell command:
1056N/Asetxkbmap -option "terminate:ctrl_alt_bksp"
1276N/A </
p></
div><
div class="sect2"><
div class="titlepage"><
div><
div><
h3 class="title"><
a id="Advanced_Configuration"></
a>Advanced Configuration</
h3></
div></
div></
div><
p>
1056N/AYou can use multi-layouts xkb configuration.
1056N/AWhat does it mean? Basically it allows to load up to four different
1056N/Akeyboard layouts at a time. Each such layout would reside in its
1056N/Aown group. The groups (unlike complete keyboard remapping) can be
1056N/Aswitched very fast from one to another by a combination of keys.
1056N/ALet's say you want to configure your new Logitech cordless desktop
1056N/Akeyboard, you intend to use three different layouts at the same
1056N/Atime - us, czech and german (in this order), and that you are used to
1276N/A<
span class="keycap"><
strong>Alt</
strong></
span>+<
span class="keycap"><
strong>Shift</
strong></
span>
1056N/Acombination for switching among them.
1056N/AThen the configuration snippet could look like this:
1056N/A Identifier "Logitech Cordless"
1056N/A Option "XkbModel" "logicordless"
1056N/A Option "XkbLayout" "us,cz,de"
1056N/A Option "XKbOptions" "grp:alt_shift_toggle"
1056N/AOf course, this can be also done at runtime using the utility
1276N/A<
span class="command"><
strong>setxkbmap</
strong></
span>.
1056N/AThe shell command loading the same keyboard mapping would look like:
1056N/Asetxkbmap -model logicordless -layout "us,cz,de" \
1056N/A -option "grp:alt_shift_toggle"
1276N/A </
p></
div><
div class="sect2"><
div class="titlepage"><
div><
div><
h3 class="title"><
a id="Even_More_Advanced_Configuration"></
a>Even More Advanced Configuration</
h3></
div></
div></
div><
p>
1056N/AOkay, let's say you are more demanding. You do like the example
1056N/Aabove but you want it to change a bit. Let's imagine you want
1056N/Athe czech keyboard mapping to use another variant but basic.
1056N/AThe configuration snippet then changes into:
1056N/A Identifier "Logitech Cordless"
1056N/A Option "XkbModel" "logicordless"
1056N/A Option "XkbLayout" "us,cz,de"
1056N/A Option "XkbVariant" ",bksl,"
1056N/A Option "XKbOptions" "grp:alt_shift_toggle"
1056N/AThat seems tricky but it is not. The logic for settings of variants
1056N/Ais the same as for layouts, that means the first and the third variant
1056N/Asettings are left out (set to <
code class="literal">basic</
code>),
1056N/Athe second is set to <
code class="literal">bksl</
code> (a special
1056N/Avariant with an enhanced definition of the backslash key).
1056N/AAnalogously, the loading runtime will change to:
1056N/Asetxkbmap -model logicordless -layout "us,cz,de" \
1056N/A -variant ",bksl," -option "grp:alt_shift_toggle"
1276N/A </
p></
div><
div class="sect2"><
div class="titlepage"><
div><
div><
h3 class="title"><
a id="Basic_Global_Options"></
a>Basic Global Options</
h3></
div></
div></
div><
p>
1056N/AFor a list of available options, with a short decription of what they do,
1276N/Asee the section starting with <
span class="quote">“<
span class="quote"><
code class="literal">! option</
code></
span>”</
span> in the
1056N/A<
code class="filename">rules/*.lst</
code> files.
1276N/A </
p></
div></
div><
div class="sect1"><
div class="titlepage"><
div><
div><
h2 class="title" style="clear: both"><
a id="Keymap_XKB_Configuration"></
a>Keymap XKB Configuration</
h2></
div></
div></
div><
p>
1056N/AKeymap configuration is the way formerly used to configure xkb. The
1056N/Auser included a special keymap file which specified the direct xkb
1056N/Aconfiguration. This method has been obsoleted by previously described
1056N/Arules files which are far more flexible and allow simpler and more
1056N/Aintuitive syntax. It is preserved merely for compatibility reasons and
1056N/Ashould be avoided if possible.
1056N/A </
p></
div></
div></
body></
html>