keymap.c 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. * Copyright 2022 Gregory L. Dietsche <gregory.dietsche@cuw.edu>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *
  17. * To build this layout run:
  18. * qmk compile -kb kinesis/kint41 -km farmergreg
  19. *
  20. * Layout Details:
  21. * PROGM + F9 to QK_BOOT and load new firmware.
  22. * Colemak (default / PROGM+C), Dvorak (PROGM + F4) and QWERTY (PROGM+F3) layouts are available for use
  23. * CAPS LOCK is ESC (for use in VIM). Double tap to activate CAPS Lock
  24. * UP and DOWN arrows are swapped to be more like VIM
  25. * [] and {} are swapped to make programming easier
  26. */
  27. #include QMK_KEYBOARD_H
  28. enum {
  29. _COLEMAK,
  30. _DVORAK,
  31. _QWERTY,
  32. _QWERTY_GAME,
  33. _KEYPAD,
  34. _PROGM,
  35. _LAYER_COUNT,
  36. };
  37. /*
  38. * Tap Dances
  39. */
  40. enum tap_dances {
  41. TD_CAPS, // ESC on tap, CAPS on double tap
  42. };
  43. tap_dance_action_t tap_dance_actions[] = {
  44. [TD_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
  45. };
  46. /*
  47. * Key Overrides
  48. */
  49. const key_override_t lcurlytobracket = ko_make_basic(MOD_MASK_SHIFT, KC_LEFT_BRACKET, KC_LEFT_BRACKET);
  50. const key_override_t rcurlytobracket = ko_make_basic(MOD_MASK_SHIFT, KC_RIGHT_BRACKET, KC_RIGHT_BRACKET);
  51. const key_override_t lbrackettocurly = ko_make_basic(0, KC_LEFT_BRACKET, KC_LEFT_CURLY_BRACE);
  52. const key_override_t rbrackettocurly = ko_make_basic(0, KC_RIGHT_BRACKET, KC_RIGHT_CURLY_BRACE);
  53. const key_override_t **key_overrides = (const key_override_t *[]){
  54. &lcurlytobracket,
  55. &rcurlytobracket,
  56. &lbrackettocurly,
  57. &rbrackettocurly,
  58. NULL
  59. };
  60. /*
  61. * Key Maps
  62. */
  63. const uint16_t PROGMEM keymaps[_LAYER_COUNT][MATRIX_ROWS][MATRIX_COLS] = {
  64. [_COLEMAK] = LAYOUT(
  65. KC_ESC , KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8,
  66. KC_EQL , KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,
  67. KC_TAB , KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,
  68. TD(TD_CAPS), KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,
  69. KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,
  70. KC_GRV ,KC_BSLS,KC_LEFT,KC_RGHT,
  71. KC_LCTL,KC_LALT,
  72. KC_HOME,
  73. KC_BSPC,KC_DEL ,KC_END,
  74. KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR ,KC_SCRL ,KC_PAUS, TG(_KEYPAD), MO(_PROGM), // I would prefer OSL(_PROGM) but MO emulates what Kinesis does in their firmware.
  75. KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,
  76. KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN,KC_BSLS,
  77. KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_QUOT,
  78. KC_K ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,
  79. KC_DOWN,KC_UP ,KC_LBRC,KC_RBRC,
  80. KC_RGUI,KC_RCTL,
  81. KC_PGUP,
  82. KC_PGDN,KC_ENT ,KC_SPC
  83. )
  84. ,[_DVORAK] = LAYOUT(
  85. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  86. _______,_______,_______,_______,_______,_______,
  87. _______,KC_QUOT,KC_COMM,KC_DOT ,KC_P ,KC_Y ,
  88. _______,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,
  89. _______,KC_SCLN,KC_Q ,KC_J ,KC_K ,KC_X ,
  90. _______,_______,_______,_______,
  91. _______,_______,
  92. _______,
  93. _______,_______,_______,
  94. _______,_______,_______,_______,_______,_______,_______,_______, _______,
  95. _______,_______,_______,_______,_______,_______,
  96. KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_SLSH,
  97. KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_QUOT,
  98. KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,_______,
  99. _______,_______,_______,_______,
  100. _______,_______,
  101. _______,
  102. _______,_______,_______
  103. )
  104. ,[_QWERTY] = LAYOUT(
  105. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  106. _______,_______,_______,_______,_______,_______,
  107. _______,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,
  108. _______,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,
  109. _______,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,
  110. _______,_______,_______,_______,
  111. _______,_______,
  112. _______,
  113. _______,_______,_______,
  114. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  115. _______,_______,_______,_______,_______,_______,
  116. KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,_______,
  117. KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,_______,
  118. KC_N ,KC_M ,_______,_______,_______,_______,
  119. _______,_______,_______,_______,
  120. _______,_______,
  121. _______,
  122. _______,_______,_______
  123. )
  124. ,[_QWERTY_GAME] = LAYOUT( // Shift WASD over to ESDF (QWERTY). Also move T and G
  125. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  126. _______,_______,_______,_______,_______,_______,
  127. _______,KC_T ,KC_Q , KC_W ,KC_E ,KC_R ,
  128. _______,KC_G ,KC_A , KC_S ,KC_D ,KC_F ,
  129. _______,_______,_______,_______,_______,_______,
  130. _______,_______,_______,_______,
  131. _______,_______,
  132. _______,
  133. KC_SPC ,_______,_______, // BACKSPACE becomes SPACE
  134. _______,_______,_______,_______,_______,_______,_______, _______,_______,
  135. _______,_______,_______,_______,_______,_______,
  136. _______,_______,_______,_______,_______,_______,
  137. _______,_______,_______,_______,_______,_______,
  138. _______,_______,_______,_______,_______,_______,
  139. _______,_______,_______,_______,
  140. _______,_______,
  141. _______,
  142. _______,_______,KC_BSPC // SPACE becomes BACKSPACE
  143. )
  144. ,[_KEYPAD] = LAYOUT(
  145. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  146. _______,_______,_______,_______,_______,_______,
  147. _______,_______,_______,_______,_______,_______,
  148. _______,_______,_______,_______,_______,_______,
  149. _______,_______,_______,_______,_______,_______,
  150. _______,KC_INS ,_______,_______,
  151. _______,_______,
  152. _______,
  153. _______,_______,_______,
  154. _______,_______,_______ ,_______,KC_MUTE,KC_VOLD,KC_VOLU,TG(_KEYPAD), _______,
  155. _______,KC_NUM ,KC_PEQL,KC_PSLS,KC_PAST,_______,
  156. _______,KC_P7 ,KC_P8 ,KC_P9 ,KC_PMNS,_______,
  157. _______,KC_P4 ,KC_P5 ,KC_P6 ,KC_PPLS,_______,
  158. _______,KC_P1 ,KC_P2 ,KC_P3 ,KC_PENT,_______,
  159. _______,_______ ,KC_PDOT,KC_PENT,
  160. _______,_______,
  161. _______,
  162. _______,_______,KC_P0
  163. )
  164. ,[_PROGM] = LAYOUT(
  165. _______,_______,_______,DF(_QWERTY),DF(_DVORAK),_______ ,_______,_______,_______,
  166. _______,_______,_______,_______ ,_______ ,_______ ,
  167. _______,_______,_______,_______ ,_______ ,DF(_QWERTY_GAME), // The G in Colemak
  168. _______,_______,_______,_______ ,_______ ,DF(_QWERTY_GAME), // The G in QWERTY
  169. _______,_______,_______,DF(_COLEMAK),_______ ,_______,
  170. _______,_______,_______ ,_______,
  171. _______,_______,
  172. _______,
  173. _______,_______,_______,
  174. QK_BOOT,_______,_______,_______,_______,_______,_______,_______,_______,
  175. _______,_______,_______,_______,_______,_______,
  176. _______,_______,_______,_______,_______,_______,
  177. _______,_______,_______,_______,_______,_______,
  178. _______,_______,_______,_______,_______,_______,
  179. _______,_______,_______,_______,
  180. _______,_______,
  181. _______,
  182. _______,_______,_______
  183. )
  184. /*
  185. ,[_TEMPLATE] = LAYOUT(
  186. _______,_______,_______,_______,_______,_______,_______,_______,_______,
  187. _______,_______,_______,_______,_______,_______,
  188. _______,_______,_______,_______,_______,_______,
  189. _______,_______,_______,_______,_______,_______,
  190. _______,_______,_______,_______,_______,_______,
  191. _______,_______,_______,_______,
  192. _______,_______,
  193. _______,
  194. _______,_______,_______,
  195. _______,_______,_______,_______,_______,_______,_______,_______, _______,
  196. _______,_______,_______,_______,_______,_______,
  197. _______,_______,_______,_______,_______,_______,
  198. _______,_______,_______,_______,_______,_______,
  199. _______,_______,_______,_______,_______,_______,
  200. _______,_______,_______,_______,
  201. _______,_______,
  202. _______,
  203. _______,_______,_______
  204. )
  205. */
  206. };