Home | History | Annotate | Download | only in symbols
      1 // These partial variants assign ISO_Level3_Shift to various XKB keycodes
      2 // so that the third shift level can be reached.
      3 
      4 // The default behaviour:
      5 // the right Alt key (AltGr) chooses the third symbol engraved on a key.
      6 default  partial modifier_keys
      7 xkb_symbols "ralt_switch" {
      8   key <RALT> {
      9     type[Group1]="ONE_LEVEL",
     10     symbols[Group1] = [ ISO_Level3_Shift ]
     11   };
     12   include "level3(modifier_mapping)"
     13 };
     14 
     15 // Ensure a mapping to a real modifier for LevelThree.
     16 partial modifier_keys
     17 xkb_symbols "modifier_mapping" {
     18   replace key <LVL3> {
     19     type[Group1] = "ONE_LEVEL",
     20     symbols[Group1] = [ ISO_Level3_Shift ]
     21   };
     22   modifier_map Mod5 { <LVL3> };
     23 };
     24 
     25 // The right Alt key never chooses the third level.
     26 // This option attempts to undo the effect of a layout's inclusion of
     27 // 'ralt_switch'.  You may want to also select another level3 option
     28 // to map the level3 shift to some other key.
     29 partial modifier_keys
     30 xkb_symbols "ralt_alt" {
     31   key <RALT> {
     32     type[Group1]="TWO_LEVEL",
     33     type[Group2]="TWO_LEVEL",
     34     type[Group3]="TWO_LEVEL",
     35     type[Group4]="TWO_LEVEL",
     36     symbols[Group1] = [ Alt_R, Meta_R ],
     37     symbols[Group2] = [ Alt_R, Meta_R ],
     38     symbols[Group3] = [ Alt_R, Meta_R ],
     39     symbols[Group4] = [ Alt_R, Meta_R ]
     40   };
     41   modifier_map Mod1 { <RALT> };
     42 };
     43 
     44 // The right Alt key (while pressed) chooses the third shift level,
     45 // and Compose is mapped to its second level.
     46 partial modifier_keys
     47 xkb_symbols "ralt_switch_multikey" {
     48   key <RALT> {
     49     type[Group1]="TWO_LEVEL",
     50     symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
     51   };
     52   include "level3(modifier_mapping)"
     53 };
     54 
     55 // A special case of the right-Alt switch -- for use with grp:alts_toggle.
     56 hidden partial modifier_keys
     57 xkb_symbols "ralt_switch_for_alts_toggle" {
     58   virtual_modifiers LAlt, AltGr;
     59   key <LALT> {
     60     type[Group1]="PC_RALT_LEVEL2",
     61     symbols[Group1] = [ Alt_L, ISO_Prev_Group, ISO_Prev_Group ],
     62     virtualMods= LAlt
     63   };
     64   key <RALT> {
     65     type[Group1]="PC_ALT_LEVEL2",
     66     symbols[Group1] = [ ISO_Level3_Shift, ISO_Next_Group ],
     67     virtualMods= AltGr
     68   };
     69   include "level3(modifier_mapping)"
     70 };
     71 
     72 // Either Alt key (while pressed) chooses the third shift level.
     73 // (To be used mostly to imitate Mac OS functionality.)
     74 partial modifier_keys
     75 xkb_symbols "alt_switch" {
     76   include "level3(lalt_switch)"
     77   include "level3(ralt_switch)"
     78 };
     79 
     80 // The left Alt key (while pressed) chooses the third shift level.
     81 partial modifier_keys
     82 xkb_symbols "lalt_switch" {
     83   key <LALT> {
     84     type[Group1]="ONE_LEVEL",
     85     symbols[Group1] = [ ISO_Level3_Shift ]
     86   };
     87   include "level3(modifier_mapping)"
     88 };
     89 
     90 // The right Ctrl key (while pressed) chooses the third shift level.
     91 partial modifier_keys
     92 xkb_symbols "switch" {
     93   key <RCTL> {
     94     type[Group1]="ONE_LEVEL",
     95     symbols[Group1] = [ ISO_Level3_Shift ]
     96   };
     97   include "level3(modifier_mapping)"
     98 };
     99 
    100 // The Menu key (while pressed) chooses the third shift level.
    101 partial modifier_keys
    102 xkb_symbols "menu_switch" {
    103   key <MENU> {
    104     type[Group1]="ONE_LEVEL",
    105     symbols[Group1] = [ ISO_Level3_Shift ]
    106   };
    107   include "level3(modifier_mapping)"
    108 };
    109 
    110 // Either Win key (while pressed) chooses the third shift level.
    111 partial modifier_keys
    112 xkb_symbols "win_switch" {
    113   include "level3(lwin_switch)"
    114   include "level3(rwin_switch)"
    115 };
    116 
    117 // The left Win key (while pressed) chooses the third shift level.
    118 partial modifier_keys
    119 xkb_symbols "lwin_switch" {
    120   key <LWIN> {
    121     type[Group1]="ONE_LEVEL",
    122     symbols[Group1] = [ ISO_Level3_Shift ]
    123   };
    124   include "level3(modifier_mapping)"
    125 };
    126 
    127 // The right Win key (while pressed) chooses the third shift level.
    128 // (When using this map, you should set your keyboard as pc101 or pc102
    129 // instead of pc104 or pc105.)
    130 partial modifier_keys
    131 xkb_symbols "rwin_switch" {
    132   key <RWIN> {
    133     type[Group1]="ONE_LEVEL",
    134     symbols[Group1] = [ ISO_Level3_Shift ]
    135   };
    136   include "level3(modifier_mapping)"
    137 };
    138 
    139 // The Enter key on the kepypad (while pressed) chooses the third shift level.
    140 // (This is especially useful for Mac laptops which miss the right Alt key.)
    141 partial modifier_keys
    142 xkb_symbols "enter_switch" {
    143   key <KPEN> {
    144     type[Group1]="ONE_LEVEL",
    145     symbols[Group1] = [ ISO_Level3_Shift ]
    146   };
    147   include "level3(modifier_mapping)"
    148 };
    149 
    150 // The CapsLock key (while pressed) chooses the third shift level.
    151 partial modifier_keys
    152 xkb_symbols "caps_switch" {
    153   key <CAPS> {
    154     type[Group1]="ONE_LEVEL",
    155     symbols[Group1] = [ ISO_Level3_Shift ]
    156   };
    157   include "level3(modifier_mapping)"
    158 };
    159 
    160 // The Backslash key (while pressed) chooses the third shift level.
    161 partial modifier_keys
    162 xkb_symbols "bksl_switch" {
    163   key <BKSL> {
    164     type[Group1]="ONE_LEVEL",
    165     symbols[Group1] = [ ISO_Level3_Shift ]
    166   };
    167   include "level3(modifier_mapping)"
    168 };
    169 
    170 // The Less/Greater key (while pressed) chooses the third shift level.
    171 partial modifier_keys
    172 xkb_symbols "lsgt_switch" {
    173   key <LSGT> {
    174     type[Group1]="ONE_LEVEL",
    175     symbols[Group1] = [ ISO_Level3_Shift ]
    176   };
    177   include "level3(modifier_mapping)"
    178 };
    179 
    180 // The CapsLock key (while pressed) chooses the third shift level,
    181 // and latches when pressed together with another third-level chooser.
    182 partial modifier_keys
    183 xkb_symbols "caps_switch_latch" {
    184   key <CAPS> {
    185     type[Group1]="THREE_LEVEL",
    186     symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
    187   };
    188   include "level3(modifier_mapping)"
    189 };
    190 
    191 // The Backslash key (while pressed) chooses the third shift level,
    192 // and latches when pressed together with another third-level chooser.
    193 partial modifier_keys
    194 xkb_symbols "bksl_switch_latch" {
    195   key <BKSL> {
    196     type[Group1]="THREE_LEVEL",
    197     symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
    198   };
    199   include "level3(modifier_mapping)"
    200 };
    201 
    202 // The Less/Greater key (while pressed) chooses the third shift level,
    203 // and latches when pressed together with another third-level chooser.
    204 partial modifier_keys
    205 xkb_symbols "lsgt_switch_latch" {
    206   key <LSGT> {
    207     type[Group1]="THREE_LEVEL",
    208     symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ]
    209   };
    210   include "level3(modifier_mapping)"
    211 };
    212