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.

197 lines
6.2 KiB

Keymaps for several of my boards (#1641) * copied mjt keymaps from archive * All mjt boards now compile * fixed jd45-mjt breathing * Updates to fix SpaceFN but not tested yet. * Still missing either spacebar or an adjacent keypress. * Debugging rigged up for use with hid_listen. * Reverted the default keymap to use tap_layer_key rather than custom. Moved custom approach to keymap_debug.c * Fixed the lower-left side of the keymap, which needed more spacers due to the matrix being directly put into the array rather than using the keymap function. * Cleaned up JD45 keymap that uses tapkey. * Redid minivan keymap with numsym rather than raise/lower. Untested. * Created my MJT keymap for HHKB Enabled dynamic macros and moved somoe of the shortcuts around. * Minor keymap fixes to make them compile without errors. * Added home/end to right arrow cluster on DYN layer. * Added more keys to fn and dyn layers. * It wasn't using my custom layer last time somehow...? Now it will. * Compiled and installed at end of day on 8/23 * Moved macros to FKEY layer because Adjust was too hard to get into and out of without some sort of feedback. * Fixed volume controls... were reversed and disabled. * Added F13-F15 back to fkeys layer in Minivan * Created new Planck Keymap that uses the NumSym and FKeys layer approach like the Minivan. * Removed DYN layer. * Fixed diagram in planck numsym. * Cleanup for pull request. * Roadkit flip phone warning. * Replaced PLAY_NOTES_ARRAY to PLAY_SONG * reset the submodules * checked out specific commits for submodules * Removed debugging from JD45 shared config.h * Moved custom rules.mk to apropriate keymap Reset the shared rules.mk file. * Trailing return issue in rules.mk Gotta make for a smooth pull request :-)
6 years ago
Keymaps for several of my boards (#1641) * copied mjt keymaps from archive * All mjt boards now compile * fixed jd45-mjt breathing * Updates to fix SpaceFN but not tested yet. * Still missing either spacebar or an adjacent keypress. * Debugging rigged up for use with hid_listen. * Reverted the default keymap to use tap_layer_key rather than custom. Moved custom approach to keymap_debug.c * Fixed the lower-left side of the keymap, which needed more spacers due to the matrix being directly put into the array rather than using the keymap function. * Cleaned up JD45 keymap that uses tapkey. * Redid minivan keymap with numsym rather than raise/lower. Untested. * Created my MJT keymap for HHKB Enabled dynamic macros and moved somoe of the shortcuts around. * Minor keymap fixes to make them compile without errors. * Added home/end to right arrow cluster on DYN layer. * Added more keys to fn and dyn layers. * It wasn't using my custom layer last time somehow...? Now it will. * Compiled and installed at end of day on 8/23 * Moved macros to FKEY layer because Adjust was too hard to get into and out of without some sort of feedback. * Fixed volume controls... were reversed and disabled. * Added F13-F15 back to fkeys layer in Minivan * Created new Planck Keymap that uses the NumSym and FKeys layer approach like the Minivan. * Removed DYN layer. * Fixed diagram in planck numsym. * Cleanup for pull request. * Roadkit flip phone warning. * Replaced PLAY_NOTES_ARRAY to PLAY_SONG * reset the submodules * checked out specific commits for submodules * Removed debugging from JD45 shared config.h * Moved custom rules.mk to apropriate keymap Reset the shared rules.mk file. * Trailing return issue in rules.mk Gotta make for a smooth pull request :-)
6 years ago
  1. //Author: mike terhar
  2. #include QMK_KEYBOARD_H
  3. #ifdef BACKLIGHT_ENABLE
  4. #include "backlight.h"
  5. #endif
  6. enum minivan_layers {
  7. _QWERTY,
  8. _NUMSYM,
  9. _FKEYS,
  10. _FKEYGRV,
  11. _PLOVER,
  12. _ADJUST
  13. };
  14. enum planck_keycodes {
  15. QWERTY = SAFE_RANGE,
  16. DYNKEY,
  17. DYNAMIC_MACRO_RANGE,
  18. };
  19. // Fillers to make layering more clear
  20. #define _______ KC_TRNS
  21. #define FKEYS F(_FKEYS)
  22. #define NUMSYM F(_NUMSYM)
  23. #define FKEYGRV F(_FKEYGRV)
  24. #define MACSLEEP M(5)
  25. #define PLOVER M(6)
  26. #define LAYERRESET M(7)
  27. #define BACKLIT M(8)
  28. #define ADJUST M(9)
  29. #define XXXXXXX KC_NO
  30. #include "dynamic_macro.h"
  31. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  32. [_QWERTY] = {
  33. {FKEYS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
  34. {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT},
  35. {KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,SFT_T(KC_ENT) },
  36. {KC_LCTL,KC_LALT,KC_LGUI, KC_SPC,XXXXXXX,XXXXXXX,XXXXXXX,NUMSYM,KC_LEFT,KC_DOWN,KC_UP ,KC_RIGHT}
  37. },
  38. [_NUMSYM] = {
  39. {FKEYGRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
  40. {KC_DEL,KC_EXLM, KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN, ADJUST },
  41. { _______, KC_UNDS,KC_PLUS, KC_LCBR,KC_RCBR,KC_PIPE , KC_MINS,KC_EQL,KC_LBRC, KC_RBRC, KC_BSLS, _______},
  42. {_______,_______,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_HOME, KC_PGDN, KC_PGUP, KC_END}
  43. },
  44. [_FKEYS] ={
  45. {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______},
  46. {KC_DEL, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, MACSLEEP, DYN_REC_START1, DYN_REC_START2 },
  47. {KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,_______,DYN_REC_STOP},
  48. {_______,_______,_______,LAYERRESET,XXXXXXX,XXXXXXX,XXXXXXX,LAYERRESET, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
  49. },
  50. [_PLOVER] = {
  51. {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
  52. {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
  53. {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
  54. {LAYERRESET, XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
  55. },
  56. [_ADJUST] = {
  57. {_______ , RESET, _______, _______, _______, _______, _______, _______, KC_SLCK, KC_PAUS, KC_PSCR, KC_DEL },
  58. {_______ , _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, MACSLEEP, PLOVER, _______},
  59. {_______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
  60. {BACKLIT, _______, _______, LAYERRESET, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______}
  61. }
  62. };
  63. #ifdef AUDIO_ENABLE
  64. float tone_startup[][2] = SONG(STARTUP_SOUND);
  65. float tone_qwerty[][2] = SONG(QWERTY_SOUND);
  66. float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND);
  67. float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND);
  68. float tone_plover[][2] = SONG(PLOVER_SOUND);
  69. float tone_adjust[][2] = SONG(PLOVER_GOODBYE_SOUND);
  70. float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
  71. float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
  72. #endif
  73. void persistant_default_layer_set(uint16_t default_layer) {
  74. eeconfig_update_default_layer(default_layer);
  75. default_layer_set(default_layer);
  76. }
  77. const uint16_t PROGMEM fn_actions[] = {
  78. [_FKEYS] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_TAB),
  79. [_FKEYGRV] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_GRV),
  80. [_NUMSYM] = ACTION_LAYER_TAP_TOGGLE(_NUMSYM),
  81. };
  82. const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
  83. {
  84. switch(id) {
  85. case 5: // MACSLEEP
  86. if (record->event.pressed) {
  87. register_code(KC_RSFT);
  88. register_code(KC_RCTL);
  89. register_code(KC_POWER);
  90. unregister_code(KC_POWER);
  91. unregister_code(KC_RCTL);
  92. unregister_code(KC_RSFT);
  93. }
  94. break;
  95. case 6: // PLOVER
  96. if (record->event.pressed) {
  97. #ifdef AUDIO_ENABLE
  98. stop_all_notes();
  99. PLAY_NOTE_ARRAY(tone_plover, false, 0);
  100. #endif
  101. layer_off(_NUMSYM);
  102. layer_off(_FKEYS);
  103. layer_off(_ADJUST);
  104. layer_on(_PLOVER);
  105. }
  106. break;
  107. case 7: // LAYERRESET
  108. if (record->event.pressed) {
  109. #ifdef AUDIO_ENABLE
  110. PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
  111. #endif
  112. layer_off(_NUMSYM);
  113. layer_off(_FKEYS);
  114. layer_off(_PLOVER);
  115. layer_off(_ADJUST);
  116. }
  117. break;
  118. case 8: // BACKLIT
  119. if (record->event.pressed) {
  120. register_code(KC_RSFT);
  121. #ifdef BACKLIGHT_ENABLE
  122. backlight_step();
  123. #endif
  124. } else {
  125. unregister_code(KC_RSFT);
  126. }
  127. break;
  128. case 9: // ADJUST
  129. if(record->event.pressed) {
  130. #ifdef AUDIO_ENABLE
  131. stop_all_notes();
  132. PLAY_NOTE_ARRAY(tone_adjust, false, 0);
  133. #endif
  134. layer_off(_NUMSYM);
  135. layer_off(_FKEYS);
  136. layer_off(_PLOVER);
  137. layer_on(_ADJUST);
  138. }
  139. }
  140. return MACRO_NONE;
  141. };
  142. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  143. uint16_t macro_kc = keycode;
  144. if (keycode == FKEYS || keycode == ADJUST || keycode == FKEYGRV ){
  145. macro_kc = DYN_REC_STOP;
  146. }
  147. if (!process_record_dynamic_macro(macro_kc, record)) {
  148. return false;
  149. }
  150. return true;
  151. }
  152. void matrix_init_user(void) {
  153. #ifdef AUDIO_ENABLE
  154. startup_user();
  155. #endif
  156. }
  157. #ifdef AUDIO_ENABLE
  158. void startup_user()
  159. {
  160. _delay_ms(20); // gets rid of tick
  161. PLAY_NOTE_ARRAY(tone_startup, false, 0);
  162. }
  163. void shutdown_user()
  164. {
  165. PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
  166. _delay_ms(150);
  167. stop_all_notes();
  168. }
  169. void music_on_user(void)
  170. {
  171. music_scale_user();
  172. }
  173. void music_scale_user(void)
  174. {
  175. PLAY_NOTE_ARRAY(music_scale, false, 0);
  176. }
  177. #endif