Firmware for ErgoDone split keyboard
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.
 
 

205 rivejä
10 KiB

  1. #include QMK_KEYBOARD_H
  2. #include "debug.h"
  3. #include "action_layer.h"
  4. #include "version.h"
  5. #define BASE 0 // Base = Workman-D
  6. #define NUMB 1 // numbers
  7. #define FNCK 2 // F#
  8. // Useful link: https://docusaurus.qmk.fm/keycodes
  9. enum custom_keycodes {
  10. PLACEHOLDER = SAFE_RANGE, // can always be here
  11. VRSN,
  12. DYNAMIC_MACRO_RANGE
  13. };
  14. #include "dynamic_macro.h"
  15. // [Info]
  16. // Meh = LCtrl + LAlt + LShift
  17. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  18. /* Keymap 0: WORKMAN-D Basic layer
  19. *
  20. * ,--------------------------------------------------. ,--------------------------------------------------.
  21. * | Esc/Meh| 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | Ins/Meh|
  22. * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
  23. * | Tab/L_F| Q | H | R | W | B | Psc | | Scl | J | F | U | P | ' | \ /L_F |
  24. * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  25. * | LShift | A | S | D | T | G |------| |------| Y | N | E | O | I | ;/RShft|
  26. * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------|
  27. * | LAlt | Z | X | M | C | V | Cmd | | Cmd | K | L | , | . | / | RAlt |
  28. * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  29. * |LCtrl | Left | Up | Down | Right| | Up | Down | [ | ] | RCtrl|
  30. * `----------------------------------' `----------------------------------'
  31. * ,-------------. ,-------------.
  32. * |L_NUMB| ` | | Home | End |
  33. * ,------|------|------| |------+------+------.
  34. * | | | App | | PgUp | | |
  35. * | Space|Backsp|------| |------| Del |Enter |
  36. * | |ace | LCmd | | PgDn | | |
  37. * `--------------------' `--------------------'
  38. */
  39. // If it accepts an argument (i.e, is a function), it doesn't need KC_.
  40. // Otherwise, it needs KC_*
  41. [BASE] = LAYOUT_ergodox(
  42. // left hand
  43. MEH_T(KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
  44. LT(FNCK,KC_TAB),KC_Q, KC_H, KC_R, KC_W, KC_B, KC_PSCR,
  45. KC_LSFT, KC_A, KC_S, KC_D, KC_T, KC_G,
  46. KC_LALT, KC_Z, KC_X, KC_M, KC_C, KC_V, LALT(KC_LGUI),
  47. KC_LCTL, KC_LEFT, KC_UP, KC_DOWN,KC_RGHT,
  48. MO(NUMB), KC_GRV,
  49. KC_LALT,
  50. KC_SPC,KC_BSPC, KC_LGUI,
  51. // right hand
  52. KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQUAL, MEH_T(KC_INS),
  53. KC_SCROLL_LOCK, KC_J, KC_F, KC_U, KC_P, KC_QUOT, LT(FNCK,KC_BSLS),
  54. KC_Y, KC_N, KC_E, KC_O, KC_I, RSFT_T(KC_SCLN),
  55. RALT(KC_RGUI), KC_K, KC_L, KC_COMM,KC_DOT, KC_SLSH, KC_RALT,
  56. KC_WBAK, KC_WFWD,KC_LBRC, KC_RBRC, KC_RCTL,
  57. KC_HOME, KC_END,
  58. KC_PGUP,
  59. KC_PGDN, KC_DEL, KC_ENT
  60. ),
  61. /* Keymap 1: Numeric Layer
  62. *
  63. * ,---------------------------------------------------. ,--------------------------------------------------.
  64. * | | | |NLock | / | * | - | | | | | | | | |
  65. * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
  66. * | | | | 7 | 8 | 9 | + | | | | | | | | |
  67. * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  68. * | | | | 4 | 5 | 6 |------| |------| | | | | | |
  69. * |---------+------+------+------+------+------| Ret | | |------+------+------+------+------+--------|
  70. * | | | | 1 | 2 | 3 | | | | | | | | | |
  71. * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  72. * | | | | 0 | . | | | | | | |
  73. * `-----------------------------------' `----------------------------------'
  74. * ,-------------. ,-------------
  75. * | | | | | |
  76. * ,------|------|------| |------+------+------.
  77. * | | | | | | | |
  78. * | | |------| |------| | |
  79. * | | | | | | | |
  80. * `--------------------' `--------------------'
  81. */
  82. // Function Keys
  83. [NUMB] = LAYOUT_ergodox(
  84. // left hand
  85. _______,_______,_______,KC_NUM_LOCK, KC_PSLS,KC_PAST,KC_PMNS,
  86. _______,_______,_______,KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,
  87. _______,_______,_______,KC_KP_4,KC_KP_5,KC_KP_6,
  88. _______,_______,_______,KC_KP_1,KC_KP_2,KC_KP_3,KC_KP_ENTER,
  89. _______,_______,_______,KC_KP_0,KC_KP_DOT,
  90. _______,_______,
  91. _______,
  92. _______,_______,_______,
  93. // right hand
  94. _______,_______,_______,_______,_______,_______,_______,
  95. _______,_______,_______,_______,_______,_______,_______,
  96. _______,_______,_______,_______,_______,_______,
  97. _______,_______,_______,_______,_______,_______,_______,
  98. _______,_______,_______,_______,_______,
  99. _______,_______,
  100. _______,
  101. _______,_______,_______
  102. ),
  103. /* Keymap 2: Fn Layer
  104. *
  105. * ,---------------------------------------------------. ,--------------------------------------------------.
  106. * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
  107. * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
  108. * | | | | | | | | | | | | | | | |
  109. * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  110. * | | | | | | |------| |------| | | | | | |
  111. * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
  112. * | | | | | | | | | | | | | | | |
  113. * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
  114. * | | | | | | | | | | | |
  115. * `-----------------------------------' `----------------------------------'
  116. * ,-------------. ,-------------
  117. * | | | | | |
  118. * ,------|------|------| |------+------+------.
  119. * | | | | | | | |
  120. * | | |------| |------| | |
  121. * | | | | | | | |
  122. * `--------------------' `--------------------'
  123. */
  124. // Function Keys
  125. [FNCK] = LAYOUT_ergodox(
  126. // left hand
  127. _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
  128. _______,_______,_______,_______,_______,_______,_______,
  129. _______,_______,_______,_______,_______,_______,
  130. _______,_______,_______,_______,_______,_______,_______,
  131. _______,_______,_______,_______,_______,
  132. _______,_______,
  133. _______,
  134. _______,_______,_______,
  135. // right hand
  136. KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
  137. _______,_______,_______,_______,_______,_______,_______,
  138. _______,_______,_______,_______,_______,_______,
  139. _______,_______,_______,_______,_______,_______,_______,
  140. _______,_______,_______,_______,_______,
  141. _______,_______,
  142. _______,
  143. _______,_______,_______
  144. ),
  145. };
  146. const uint16_t PROGMEM fn_actions[] = {
  147. [1] = ACTION_LAYER_TAP_TOGGLE(NUMB), // FN1 - Momentary Layer 1 (Numbers)
  148. };
  149. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  150. if (!process_record_dynamic_macro(keycode, record)) {
  151. return false;
  152. }
  153. switch (keycode) {
  154. case VRSN:
  155. if (record->event.pressed) {
  156. SEND_STRING (" <[ Dejvino's Keyboard ]> ");
  157. }
  158. return false;
  159. break;
  160. }
  161. return true;
  162. }
  163. // Runs just one time when the keyboard initializes.
  164. void matrix_init_user(void) {
  165. //set_unicode_input_mode(UC_LINX);
  166. };
  167. // Runs constantly in the background, in a loop.
  168. void matrix_scan_user(void) {
  169. uint8_t layer = biton32(layer_state);
  170. ergodox_board_led_off();
  171. ergodox_right_led_1_off();
  172. ergodox_right_led_2_off();
  173. ergodox_right_led_3_off();
  174. switch (layer) {
  175. case FNCK:
  176. ergodox_right_led_1_on();
  177. break;
  178. case NUMB:
  179. ergodox_right_led_2_on();
  180. break;
  181. default:
  182. // none
  183. break;
  184. }
  185. };