diff options
author | Benno Schulenberg <bensberg@telfort.nl> | 2023-04-09 12:42:48 +0200 |
---|---|---|
committer | Benno Schulenberg <bensberg@telfort.nl> | 2023-04-10 17:10:30 +0200 |
commit | 54457f7b5760de2e6de7ee759603c032eb1d8e17 (patch) | |
tree | b154447f5c4439d22ace6e8d87b7d6f09d5623ae /symbols | |
parent | 5e97fe105e553412a838e037afd261fdb5c6211a (diff) | |
download | xkeyboard-config-54457f7b5760de2e6de7ee759603c032eb1d8e17.tar.gz |
symbols/level*: contract each key definition onto one line, when possible
This makes it easier to see where which symbols are assigned to a key
when grepping for its code.
Also improve a couple of comments.
Diffstat (limited to 'symbols')
-rw-r--r-- | symbols/level2 | 9 | ||||
-rw-r--r-- | symbols/level3 | 94 | ||||
-rw-r--r-- | symbols/level5 | 105 |
3 files changed, 61 insertions, 147 deletions
diff --git a/symbols/level2 b/symbols/level2 index 5c02e0f..fa2e32d 100644 --- a/symbols/level2 +++ b/symbols/level2 @@ -1,10 +1,5 @@ -// These partial variants assign Shift to various XKB keycodes. - -// The Less/Greater key (while pressed) chooses the second shift level. +// The Less/Greater key (while pressed) chooses the second level. partial modifier_keys xkb_symbols "lsgt_switch" { - key <LSGT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ Shift_L ] - }; + key <LSGT> {[ Shift_L ], type[group1]="ONE_LEVEL" }; }; diff --git a/symbols/level3 b/symbols/level3 index f76906f..95d02a3 100644 --- a/symbols/level3 +++ b/symbols/level3 @@ -1,14 +1,11 @@ -// These partial variants assign ISO_Level3_Shift to various XKB keycodes -// so that the third shift level can be reached. +// These variants assign ISO_Level3_Shift to various keys +// so that levels 3 and 4 can be reached. // The default behaviour: // the right Alt key (AltGr) chooses the third symbol engraved on a key. default partial modifier_keys xkb_symbols "ralt_switch" { - key <RALT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <RALT> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The right Alt key never chooses the third level. @@ -17,10 +14,7 @@ xkb_symbols "ralt_switch" { // to map the level3 shift to some other key. partial modifier_keys xkb_symbols "ralt_alt" { - key <RALT> { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ Alt_R, Meta_R ] - }; + key <RALT> {[ Alt_R, Meta_R ], type[group1]="TWO_LEVEL" }; modifier_map Mod1 { <RALT> }; }; @@ -28,10 +22,7 @@ xkb_symbols "ralt_alt" { // and Compose is mapped to its second level. partial modifier_keys xkb_symbols "ralt_switch_multikey" { - key <RALT> { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, Multi_key ] - }; + key <RALT> {[ ISO_Level3_Shift, Multi_key ], type[group1]="TWO_LEVEL" }; }; // Either Alt key (while pressed) chooses the third shift level. @@ -45,28 +36,19 @@ xkb_symbols "alt_switch" { // The left Alt key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "lalt_switch" { - key <LALT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <LALT> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The right Ctrl key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "switch" { - key <RCTL> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <RCTL> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The Menu key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "menu_switch" { - key <MENU> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <MENU> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // Either Win key (while pressed) chooses the third shift level. @@ -79,100 +61,72 @@ xkb_symbols "win_switch" { // The left Win key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "lwin_switch" { - key <LWIN> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <LWIN> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The right Win key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "rwin_switch" { - key <RWIN> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <RWIN> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The Enter key on the kepypad (while pressed) chooses the third shift level. // (This is especially useful for Mac laptops which miss the right Alt key.) partial modifier_keys xkb_symbols "enter_switch" { - key <KPEN> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <KPEN> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The CapsLock key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "caps_switch" { - key <CAPS> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <CAPS> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The Backslash key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "bksl_switch" { - key <BKSL> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <BKSL> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The Less/Greater key (while pressed) chooses the third shift level. partial modifier_keys xkb_symbols "lsgt_switch" { - key <LSGT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; + key <LSGT> {[ ISO_Level3_Shift ], type[group1]="ONE_LEVEL" }; }; // The CapsLock key (while pressed) chooses the third shift level, // and latches when pressed together with another third-level chooser. partial modifier_keys xkb_symbols "caps_switch_latch" { - key <CAPS> { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; + key <CAPS> {[ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ], + type[group1]="THREE_LEVEL" }; }; // The Backslash key (while pressed) chooses the third shift level, // and latches when pressed together with another third-level chooser. partial modifier_keys xkb_symbols "bksl_switch_latch" { - key <BKSL> { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; + key <BKSL> {[ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ], + type[group1]="THREE_LEVEL" }; }; // The Less/Greater key (while pressed) chooses the third shift level, // and latches when pressed together with another third-level chooser. partial modifier_keys xkb_symbols "lsgt_switch_latch" { - key <LSGT> { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; + key <LSGT> {[ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ], + type[group1]="THREE_LEVEL" }; }; -// Number key 4 chooses third shift level when pressed in isolation. +// Top-row digit key 4 chooses third shift level when pressed alone. partial modifier_keys xkb_symbols "4_switch_isolated" { - override key <AE04> { - symbols[Group1] = [ ISO_Level3_Shift ] - }; + override key <AE04> {[ ISO_Level3_Shift ]}; }; -// Number key 9 chooses third shift level when pressed in isolation. +// Top-row digit key 9 chooses third shift level when pressed alone. partial modifier_keys xkb_symbols "9_switch_isolated" { - override key <AE09> { - symbols[Group1] = [ ISO_Level3_Shift ] - }; + override key <AE09> {[ ISO_Level3_Shift ]}; }; diff --git a/symbols/level5 b/symbols/level5 index 6e29515..330fbc4 100644 --- a/symbols/level5 +++ b/symbols/level5 @@ -1,144 +1,109 @@ -// These partial variants assign ISO_Level5_Shift to various XKB keycodes -// so that the fifth shift level can be reached. +// These variants assign ISO_Level5_Shift to various keys +// so that levels 5 to 8 can be reached. // The right Ctrl key (while pressed) chooses the fifth shift level. partial modifier_keys xkb_symbols "rctrl_switch" { - key <RCTL> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift ] - }; + key <RCTL> {[ ISO_Level5_Shift ], type[group1]="ONE_LEVEL" }; }; // The Less/Greater key (while pressed) chooses the fifth shift level. partial modifier_keys xkb_symbols "lsgt_switch" { - key <LSGT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift ] - }; + key <LSGT> {[ ISO_Level5_Shift ], type[group1]="ONE_LEVEL" }; }; // The right Alt key (while pressed) chooses the fifth shift level. partial modifier_keys xkb_symbols "ralt_switch" { - key <RALT> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift ] - }; + key <RALT> {[ ISO_Level5_Shift ], type[group1]="ONE_LEVEL" }; }; // The CapsLock key (while pressed) chooses the fifth shift level. partial modifier_keys xkb_symbols "caps_switch" { - key <CAPS> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift ] - }; + key <CAPS> {[ ISO_Level5_Shift ], type[group1]="ONE_LEVEL" }; }; // The Menu key (while pressed) chooses the fifth shift level. partial modifier_keys xkb_symbols "menu_switch" { - key <MENU> { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift ] - }; + key <MENU> {[ ISO_Level5_Shift ], type[group1]="ONE_LEVEL" }; }; + // This adds the definitions needed to create a level5-locking behaviour, // using the virtual modifier NumLock (mapped to Mod2) as lock indicator. // See also types/level5 (EIGHT_LEVEL_WITH_LEVEL5_LOCK) and compat/level5 (level5_lock). partial modifier_keys xkb_symbols "lock" { - replace key <HYPR> { - vmods = NumLock, - type[Group1] = "ONE_LEVEL", - symbols[Group1] = [ NoSymbol ], - actions[Group1] = [ SetMods(modifiers=NumLock) ] - }; + replace key <HYPR> {[ NoSymbol ], type[group1] = "ONE_LEVEL", vmods = NumLock, + actions[group1] = [ SetMods(modifiers=NumLock) ]}; modifier_map Mod2 { <HYPR> }; }; -// The following modifier keys are used to switch to the third shift level -// and to set a corresponding lock, implemented as NumLock. +// Below are eight variants for assigning extra keys for choosing/locking the fifth level. partial modifier_keys xkb_symbols "lsgt_switch_lock" { include "level5(lock)" - key <LSGT> { - type[Group1] = "EIGHT_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <LSGT> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL" }; }; partial modifier_keys xkb_symbols "lwin_switch_lock" { include "level5(lock)" - key <LWIN> { - type[Group1] = "EIGHT_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <LWIN> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL" }; }; partial modifier_keys xkb_symbols "ralt_switch_lock" { include "level5(lock)" - key <RALT> { - type[Group1] = "EIGHT_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <RALT> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL" }; }; partial modifier_keys xkb_symbols "rwin_switch_lock" { include "level5(lock)" - key <RWIN> { - type[Group1] = "EIGHT_LEVEL", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <RWIN> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL" }; }; partial modifier_keys xkb_symbols "lsgt_switch_lock_cancel" { include "level5(lock)" - key <LSGT> { - type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <LSGT> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK" }; }; partial modifier_keys xkb_symbols "lwin_switch_lock_cancel" { include "level5(lock)" - key <LWIN> { - type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <LWIN> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK" }; }; partial modifier_keys xkb_symbols "ralt_switch_lock_cancel" { include "level5(lock)" - key <RALT> { - type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <RALT> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK" }; }; partial modifier_keys xkb_symbols "rwin_switch_lock_cancel" { include "level5(lock)" - key <RWIN> { - type[Group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK", - symbols[Group1] = [ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, - ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ] - }; + key <RWIN> {[ ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, ISO_Level5_Shift, + ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock, ISO_Level5_Lock ], + type[group1] = "EIGHT_LEVEL_WITH_LEVEL5_LOCK" }; }; |