Signed-off-by: Ran Benita <ran234@gmail.com>
-# The `xkb_keycodes` section
+# The XKB keymap text format, V1
+
+This document describes the `XKB_KEYMAP_FORMAT_TEXT_V1` keymap format,
+as implemented by libxkbcommon.
+
+A keymap consists of a single top-level `xkb_keymap` block, underwhich
+are nested the following sections.
+
+
+## The `xkb_keycodes` section
This is the simplest section type, and is the first one to be
compiled. The purpose of this is mostly to map between the
hardware/evdev scancodes and xkb keycodes. Each key is given a name
by which it can be referred to later, e.g. in the symbols section.
This is the simplest section type, and is the first one to be
compiled. The purpose of this is mostly to map between the
hardware/evdev scancodes and xkb keycodes. Each key is given a name
by which it can be referred to later, e.g. in the symbols section.
or same keycode given different names, it is resolved according to the
merge mode which applies to the definitions.
or same keycode given different names, it is resolved according to the
merge mode which applies to the definitions.
name (here `<MENU>`). Conflicts are handled similarly to keycode
statements.
name (here `<MENU>`). Conflicts are handled similarly to keycode
statements.
-# The `xkb_types` section
+## The `xkb_types` section
This section is the second to be processesed, after `xkb_keycodes`.
However, it is completely independent and could have been the first to
This section is the second to be processesed, after `xkb_keycodes`.
However, it is completely independent and could have been the first to
`TWO_LEVEL` (with Shift choosing the second level), `ALPHABETIC`
(where Caps Lock may also choose the second level), etc.
`TWO_LEVEL` (with Shift choosing the second level), `ALPHABETIC`
(where Caps Lock may also choose the second level), etc.
The body of the definition may include statements of the following
forms:
The body of the definition may include statements of the following
forms:
-### `level_name` statements
+#### `level_name` statements
level_name[Level1] = "Base";
level_name[Level1] = "Base";
Note: A level may be specified as Level[1-8] or just a number (can
be more than 8).
Note: A level may be specified as Level[1-8] or just a number (can
be more than 8).
-### `modifiers` statement
+#### `modifiers` statement
modifiers = Shift+Lock+LevelThree;
modifiers = Shift+Lock+LevelThree;
The other modifiers, whether active or not, are masked out in the
calculation.
The other modifiers, whether active or not, are masked out in the
calculation.
-### `map` entry statements
+#### `map` entry statements
map[Shift+LevelThree] = Level4;
map[Shift+LevelThree] = Level4;
modifiers are active, while the `Lock` modifier is not, then the
keysym(s) in the 4th level of the group will be returned to the user.
modifiers are active, while the `Lock` modifier is not, then the
keysym(s) in the 4th level of the group will be returned to the user.
-### `preserve` statements
+#### `preserve` statements
map[Shift+Lock+LevelThree] = Level5;
preserve[Shift+Lock+LevelThree] = Lock;
map[Shift+Lock+LevelThree] = Level5;
preserve[Shift+Lock+LevelThree] = Lock;
-# The `xkb_compat` section
+## The `xkb_compat` section
This section is the third to be processed, after `xkb_keycodes` and
`xkb_types`.
This section is the third to be processed, after `xkb_keycodes` and
`xkb_types`.
+### Interpret statements
The body of the statement may include statements of the following
forms (all of which are optional):
The body of the statement may include statements of the following
forms (all of which are optional):
-### `useModMapMods` statement
+#### `useModMapMods` statement
the first level of the first group of the keys. This can be useful in
conjunction with e.g. a `virtualModifier` statement.
the first level of the first group of the keys. This can be useful in
conjunction with e.g. a `virtualModifier` statement.
action = LockMods(modifiers=NumLock);
Bind this action to the matching levels.
action = LockMods(modifiers=NumLock);
Bind this action to the matching levels.
-### `virtualModifier` statement
+#### `virtualModifier` statement
virtualModifier = NumLock;
virtualModifier = NumLock;
virtual_modifiers NumLock;
virtual_modifiers NumLock;
repeat = True;
Set whether the key should repeat or not. Must be a boolean value.
repeat = True;
Set whether the key should repeat or not. Must be a boolean value.
state which will cause the LED to be lit. It may include the following
statements:
state which will cause the LED to be lit. It may include the following
statements:
-### `modifiers` statement
+#### `modifiers` statement
modifiers = ScrollLock;
If the given modifiers are in the required state (see below), the
LED is lit.
modifiers = ScrollLock;
If the given modifiers are in the required state (see below), the
LED is lit.
-### `whichModState` statment
+#### `whichModState` statment
whichModState = Latched+Locked;
whichModState = Latched+Locked;
Whenever the NumLock modifier is locked, the Num Lock LED will light
up.
Whenever the NumLock modifier is locked, the Num Lock LED will light
up.
groups = All - group1;
If the given groups are in the required state (see below), the LED is
lit.
groups = All - group1;
If the given groups are in the required state (see below), the LED is
lit.
-### `whichGroupState` statement
+#### `whichGroupState` statement
whichGroupState = Effective;
whichGroupState = Effective;
satisfied the LED is lit.
satisfied the LED is lit.
-# The `xkb_symbols` section
+## The `xkb_symbols` section
This section is the fourth to be processed, after `xkb_keycodes`,
`xkb_types` and `xkb_compat`.
This section is the fourth to be processed, after `xkb_keycodes`,
`xkb_types` and `xkb_compat`.
-# Virtual modifier statements
+## Virtual modifier statements