Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Mar 21, 2024
1 parent 0933c07 commit 8b58dca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions doc/diagrams/xkb-types-explanation.dot
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ digraph
];
modifiers_filter [
shape=box,
label=<<b>Filter modifiers</b><br/>Keep only <i>meaningful</i> modifiers for the key type>,
label=<<b>Filter modifiers</b><br/>Keep only meaningful modifiers for the key type>,
style=rounded
];
filtered_modifiers [label="Filtered modifiers"];
level_match [
shape=box,
label=<<b>Lookup modifiers combination</b><br/>Find the shift level<br/>matching <i>exactly</i> the modifiers,<br/>defaulting to the base level>,
label=<<b>Lookup modifiers combination</b><br/>Find the shift level<br/>matching exactly the modifiers,<br/>defaulting to the base level>,
style=rounded
];
shift_level [
Expand Down
30 changes: 17 additions & 13 deletions doc/keymap-format-text-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,13 @@ Key types have four parameters:

<dl>
<dt>@ref key-type-level-name "Shift level names"</dt>
<dd>Declare [shift levels]. Mainly for documentation</dd>
<dd>Declare [shift levels]. Mainly for documentation.</dd>
<dt>@ref key-type-modifiers "Modifiers filter"</dt>
<dd>Declare what modifiers should be taken into account in the mapping.</dd>
<dt>@ref key-type-map "Modifiers mapping"</dt>
<dd>Lookup table to translate modifiers combinations into shift levels</dd>
<dd>Lookup table to translate modifiers combinations into shift levels.</dd>
<dt>@ref key-type-preserve "Modifiers preservation"</dt>
<dd>Tweak the computation of [consumed modifiers]</dd>
<dd>Tweak the computation of [consumed modifiers].</dd>
</dl>

[consumed modifiers]: @ref consumed-modifiers
Expand All @@ -826,7 +826,7 @@ Key types are used to compute:
- the [consumed modifiers][]: see xkb_state::xkb_state_key_get_consumed_mods() and
xkb_state::xkb_state_key_get_consumed_mods2().

The following diagram present an overview of theses computations:
The following diagram presents an overview of theses computations:

@anchor xkb-types-explanation-diagram
@dotfile xkb-types-explanation "Use of key types to compute shift level and consumed modifiers"
Expand Down Expand Up @@ -968,6 +968,10 @@ with concrete layouts.
[TWO_LEVEL]: @ref TWO_LEVEL
[ALPHABETIC]: @ref ALPHABETIC

<!-- NOTE: In the following code excerpts, the empty comments are intented
to enable code alignment when scrren is large enough to display two
example on the same row. -->

<div class="example-container">
<div class="example">
<div class="example-inner">
Expand All @@ -982,7 +986,7 @@ type "TWO_LEVEL" {
// Define mapping
map[None] = Level1; // No modifier -> level 1
map[Shift] = Level2; // Exactly Shift -> level 2

// (no map entry with Lock)
// Define level names
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
Expand Down Expand Up @@ -1061,14 +1065,14 @@ type "FOUR_LEVEL" {
modifiers = Shift + LevelThree;
map[None] = Level1;
map[Shift] = Level2;


// (no map entry with Lock)
// (no map entry with Lock)
map[LevelThree] = Level3;
map[Shift+LevelThree] = Level4;




// (no map entry with Lock)
// (no map entry with Lock)
// (no preserve entry with Lock)
// (no preserve entry with Lock)
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "AltGr";
Expand Down Expand Up @@ -1151,8 +1155,8 @@ type "FOUR_LEVEL_ALPHABETIC" {
map[Shift+LevelThree] = Level4;
map[Lock+LevelThree] = Level4;
map[Shift+Lock+LevelThree] = Level3;


// (no preserve entry with Lock)
// (no preserve entry with Lock)
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "AltGr";
Expand Down

0 comments on commit 8b58dca

Please sign in to comment.