level3 7.0 KB

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