You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

306 lines
10 KiB

  1. /*
  2. * Good on you for modifying your layout, this is the most nonQMK layout you will come across
  3. * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
  4. *
  5. * Don't modify the steno layer directly, instead add chords using the keycodes and macros
  6. * from sten.h to the layout you want to modify.
  7. *
  8. * Observe the comment above processQWERTY!
  9. *
  10. * http://docs.gboards.ca
  11. */
  12. #include QMK_KEYBOARD_H
  13. #include "sten.h"
  14. #include "keymap_steno.h"
  15. #define IGNORE_MOD_TAP_INTERRUPT
  16. // Steno Layers
  17. #define FUNCT ( LSD | LK | LP | LH )
  18. #define MEDIA ( LSD | LK | LW | LR )
  19. #define MOVE ( LSD | LK )
  20. #define NUM ( PWR )
  21. #define SYM ( RZ )
  22. // Keys and chords that, once they appear, are added to every subsequent partial chord
  23. // until the whole thing is sent.
  24. uint32_t stenoLayers[] = {NUM, SYM, MOVE, MEDIA, FUNCT};
  25. // QMK Layers
  26. #define STENO_LAYER 0
  27. #define GAMING 1
  28. #define GAMING_2 2
  29. /* Keyboard Layout
  30. * ,---------------------------------. ,------------------------------.
  31. * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
  32. * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
  33. * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RB | RG | RS | RZ |
  34. * `---------------------------------' `------------------------------'
  35. * ,---------------, .---------------.
  36. * | LNO | LA | LO | | RE | RU | RNO |
  37. * `---------------' `---------------'
  38. */
  39. // Note: You can only use basic keycodes here!
  40. //
  41. // P() is just a wrapper to make your life easier.
  42. // PC() applies the mapping to all of the StenoLayers. For overloading, define these last.
  43. //
  44. // FN is unavailable. That is reserved for system use.
  45. // Chords containing PWR are always available, even in steno mode.
  46. //
  47. // http://docs.gboards.ca
  48. uint32_t processQwerty(bool lookup) {
  49. // Special keys
  50. P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__));
  51. P( LFT | LK | LP | LW, REPEAT());
  52. // Mouse Keys
  53. /* P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2)); */
  54. /* P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1)); */
  55. /* Function layer
  56. * ,-----------------------------------, ,-----------------------------------,
  57. * | | | | NCTFUNCTF | | | | F1 | F2 | F3 | F4 | |
  58. * | + + + + + | | + F5 + F6 + F7 + F8 + |
  59. * | | FUNCTFUNC | | | | | | F9 | F10 | F11 | F12 | |
  60. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  61. */
  62. P( FUNCT | RF, SEND(KC_F1));
  63. P( FUNCT | RP, SEND(KC_F2));
  64. P( FUNCT | RL, SEND(KC_F3));
  65. P( FUNCT | RT, SEND(KC_F4));
  66. P( FUNCT | RF | RR, SEND(KC_F5));
  67. P( FUNCT | RP | RB, SEND(KC_F6));
  68. P( FUNCT | RL | RG, SEND(KC_F7));
  69. P( FUNCT | RT | RS, SEND(KC_F8));
  70. P( FUNCT | RR, SEND(KC_F9));
  71. P( FUNCT | RG, SEND(KC_F10));
  72. P( FUNCT | RB, SEND(KC_F11));
  73. P( FUNCT | RS, SEND(KC_F12));
  74. /* Movement layer
  75. * ,-----------------------------------, ,-----------------------------------,
  76. * | | | | | | | | | <- | | | -> | |
  77. * | + + + + + | | + + + + + |
  78. * | | MOVEMOVEM | | | | | | Hm | PgD | PgU | End | |
  79. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  80. */
  81. P( MOVE | RF, SEND(KC_LEFT));
  82. P( MOVE | RP, SEND(KC_DOWN));
  83. P( MOVE | RL, SEND(KC_UP));
  84. P( MOVE | RT, SEND(KC_RIGHT));
  85. P( MOVE | RR, SEND(KC_HOME));
  86. P( MOVE | RB, SEND(KC_PGDN));
  87. P( MOVE | RG, SEND(KC_PGUP));
  88. P( MOVE | RS, SEND(KC_END));
  89. /* Media Layer
  90. * ,-----------------------------------, ,-----------------------------------,
  91. * | | | | | | | | |Prev |Play | PLY |Next | VolU|
  92. * | + + + + + | | + + + + + |
  93. * | | MEDIAMEDIAMEDIAMEDIAM | | | | | | |Mute | VolD|
  94. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  95. */
  96. P( MEDIA | RF, SEND(KC_MPRV));
  97. P( MEDIA | RP, SEND(KC_MPLY));
  98. P( MEDIA | RL, SEND(KC_MPLY));
  99. P( MEDIA | RT, SEND(KC_MNXT));
  100. P( MEDIA | RD, SEND(KC_VOLU));
  101. P( MEDIA | RS, SEND(KC_MUTE));
  102. P( MEDIA | RZ, SEND(KC_VOLD));
  103. /* Numbers
  104. * ,-----------------------------------, ,-----------------------------------,
  105. * | | | a | b | c | | | : | 1 | 2 | 3 | . | |
  106. * | + + d + e + f + | | 0 + 4 + 5 + 6 + - + |
  107. * | NUM | | | | | | | | 7 | 8 | 9 | 0 | |
  108. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  109. */
  110. P( NUM | LFT, SEND(KC_A));
  111. P( NUM | LP, SEND(KC_B));
  112. P( NUM | LH, SEND(KC_C));
  113. P( NUM | LK, SEND(KC_D));
  114. P( NUM | LW, SEND(KC_E));
  115. P( NUM | LR, SEND(KC_F));
  116. // Right hand
  117. P( NUM | ST3, SEND_STRING(":"));
  118. P( NUM | RF, SEND(KC_1));
  119. P( NUM | RP, SEND(KC_2));
  120. P( NUM | RL, SEND(KC_3));
  121. P( NUM | RT, SEND(KC_DOT));
  122. P( NUM | ST3 | ST4, SEND(KC_0));
  123. P( NUM | RF | RR, SEND(KC_4));
  124. P( NUM | RP | RB, SEND(KC_5));
  125. P( NUM | RG | RL, SEND(KC_6));
  126. P( NUM | RT | RS, SEND(KC_MINUS));
  127. P( NUM | RR, SEND(KC_7));
  128. P( NUM | RB, SEND(KC_8));
  129. P( NUM | RG, SEND(KC_9));
  130. P( NUM | RS, SEND(KC_0));
  131. /* Symbols
  132. * ,-----------------------------------, ,-----------------------------------,
  133. * | | ` | [ | { | ( | < | | > | ) | } | ] | ? | |
  134. * | + ~ + - + ' + : + _ | | \ + = + " + + + ? + |
  135. * | | ! | @ | # | $ | % | | | | ^ | & | * | ? | SYM |
  136. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  137. */
  138. // Left hand
  139. P( SYM | LSU, SEND(KC_GRV));
  140. P( SYM | LFT, SEND(KC_LBRC));
  141. P( SYM | LP, SEND_STRING("{"));
  142. P( SYM | LH, SEND_STRING("("));
  143. P( SYM | ST1, SEND_STRING("<"));
  144. P( SYM | LSU | LSD, SEND_STRING("~"));
  145. P( SYM | LFT | LK, SEND(KC_MINS));
  146. P( SYM | LP | LW, SEND(KC_QUOTE));
  147. P( SYM | LH | LR, SEND_STRING(":"));
  148. P( SYM | ST1 | ST2, SEND_STRING("_"));
  149. P( SYM | LSD, SEND_STRING("!"));
  150. P( SYM | LK, SEND_STRING("@"));
  151. P( SYM | LW, SEND_STRING("#"));
  152. P( SYM | LR, SEND_STRING("$"));
  153. P( SYM | ST2, SEND_STRING("%"));
  154. // Right hand
  155. P( SYM | ST3, SEND_STRING(">"));
  156. P( SYM | RF, SEND_STRING(")"));
  157. P( SYM | RP, SEND_STRING("}"));
  158. P( SYM | RL, SEND_STRING("]"));
  159. P( SYM | RT, SEND_STRING("?"));
  160. P( SYM | ST3 | ST4, SEND(KC_BACKSLASH));
  161. P( SYM | RF | RR, SEND(KC_EQUAL));
  162. P( SYM | RP | RB, SEND_STRING("\""));
  163. P( SYM | RG | RL, SEND_STRING("+"));
  164. P( SYM | RT | RS, SEND_STRING("?"));
  165. P( SYM | ST4, SEND_STRING("|"));
  166. P( SYM | RR, SEND_STRING("^"));
  167. P( SYM | RB, SEND_STRING("&"));
  168. P( SYM | RG, SEND_STRING("*"));
  169. P( SYM | RS, SEND_STRING("?"));
  170. /* Letters
  171. * ,-----------------------------------, ,-----------------------------------,
  172. * | | Q | W | F | P | B | | J | L | U | Y | ; | ctl |
  173. * +-----+- A -+- R -+- S -+- T -+- G -| |- M -+- N -+- E -+- I -+- O -+-----|
  174. * | bsp | Z | X | C | D | V | | K | H | , | . | / | del |
  175. * `-----+-----+-----+-----+-----+-----' `-----+-----+-----+-----+-----+-----'
  176. * ,---------------, .---------------.
  177. * | alt | ent|shfr| | spc| gui| alt |
  178. * `---------------' `---------------'
  179. */
  180. // Left hand
  181. P( LSU, SEND(KC_Q));
  182. P( LFT, SEND(KC_W));
  183. P( LP, SEND(KC_F));
  184. P( LH, SEND(KC_P));
  185. P( ST1, SEND(KC_B));
  186. P( LSU | LSD, SEND(KC_A));
  187. P( LFT | LK, SEND(KC_R));
  188. P( LP | LW, SEND(KC_S));
  189. P( LH | LR, SEND(KC_T));
  190. P( ST1 | ST2, SEND(KC_G));
  191. P( LSD, SEND(KC_Z));
  192. P( LK, SEND(KC_X));
  193. P( LW, SEND(KC_C));
  194. P( LR, SEND(KC_D));
  195. P( ST2, SEND(KC_V));
  196. // Right hand
  197. P( ST3, SEND(KC_J));
  198. P( RF, SEND(KC_L));
  199. P( RP, SEND(KC_U));
  200. P( RL, SEND(KC_Y));
  201. P( RT, SEND(KC_SCLN));
  202. P( ST3 | ST4, SEND(KC_M));
  203. P( RF | RR, SEND(KC_N));
  204. P( RP | RB, SEND(KC_E));
  205. P( RG | RL, SEND(KC_I));
  206. P( RT | RS, SEND(KC_O));
  207. P( ST4, SEND(KC_K));
  208. P( RR, SEND(KC_H));
  209. P( RB, SEND(KC_COMM));
  210. P( RG, SEND(KC_DOT));
  211. P( RS, SEND(KC_SLSH));
  212. // Thumb Chords and modifiers
  213. //
  214. PC( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
  215. PC( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
  216. // overrides
  217. P( PWR | LO, SEND(KC_LSFT); SEND(KC_BSPC));
  218. P( PWR | RD, SEND(KC_LCTL); SEND(KC_BSPC));
  219. P( RZ | RD, SEND(KC_LCTL); SEND(KC_DEL));
  220. PC( LNO | LA | LO, SEND(KC_LSFT); SEND(KC_ESC));
  221. PC( LA | LO, SEND(KC_ESC));
  222. PC( LNO, SEND(KC_LALT));
  223. PC( LA, SEND(KC_ENT));
  224. PC( LO, SEND(KC_LSFT));
  225. PC( RNO, SEND(KC_RALT));
  226. PC( RE | RU, SEND(KC_TAB));
  227. PC( RE, SEND(KC_SPC));
  228. PC( RU, SEND(KC_LGUI));
  229. PC( PWR, SEND(KC_BSPC));
  230. PC( RD, SEND(KC_LCTL));
  231. P( RZ, SEND(KC_DEL));
  232. return 0;
  233. }
  234. // "Layers"
  235. // Steno layer should be first in your map.
  236. // When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
  237. // If you need more space for chords, remove the two gaming layers.
  238. // Note: If using NO_ACTION_TAPPING, LT will not work!
  239. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  240. // Main layer, everything goes through here
  241. [STENO_LAYER] = LAYOUT_georgi(
  242. STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
  243. STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
  244. STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7
  245. ),
  246. // Gaming layer with Numpad, Very limited
  247. [GAMING] = LAYOUT_georgi(
  248. KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
  249. KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO,
  250. KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)
  251. ),
  252. [GAMING_2] = LAYOUT_georgi(
  253. KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
  254. KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT,
  255. KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER)
  256. )
  257. };
  258. // Don't fuck with this, thanks.
  259. size_t keymapsCount = ARRAY_SIZE(keymaps);
  260. size_t stenoLayerCount = ARRAY_SIZE(stenoLayers);