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.

222 lines
13 KiB

[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
[Keymap] Cleanup and updating of drashna keymap code (#11516) * Update other keyboards for rgb matrix changes * Remove customized bootmagic code * Fix corne layout compilation error * Fix compiler errors with all keymaps * Add Simple Visualizer for ergodox infinity * Fix compile issue with Corne * Fix keymap stuff * Add alias for mouse layer * Add Halmak Keyboard layout * Updates for Kyria * Add support for oled interval * Change RGB stuff [CHANGE] Fix coexistence issues * Fix rgb_stuff * Add custom ploopyco mouse keymap * Decrease default dwell time * Updates based on last breaking changes update * Disable command on dactyl * Update ergodox to use proper commands for rgb matrix indicators * Update all rgb matrix indicator functions * Update rules for dactyl-manuform * Reduce wait time for mouse layer off event * Add more info to logger * Add wrappers for get_tapping term * Move version.h include into only file that actually needs it * Update rgb sleep stuff * Update key print function * Change DM keymap settings * Change pin for DM Manuform * Add Proton C stuff for Corne keymap * more arm corne tinkering * Even more arm stuff for corne * Cleanup corne stuff * redirect default keymap to drashna because I am a very bad man * change corne rgb priority * Update tractyl manuform to not conflict * Add more secret stuff * more dactyl tweaks * Add more options to split transport * Changes of oled support * Change split settings * Improve keylogger formatting more * tweak oled stuff * Oled and such tweaks * Reduce brightness due to leds * Decrease brightness more * Only run layer code if master
3 years ago
  1. /* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "drashna.h"
  17. #ifndef UNICODE_ENABLE
  18. # define UC(x) KC_NO
  19. #endif
  20. enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE };
  21. // clang-format off
  22. #define LAYOUT_moonlander_wrapper(...) LAYOUT_moonlander(__VA_ARGS__)
  23. #define LAYOUT_moonlander_base( \
  24. K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
  25. K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
  26. K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
  27. ) \
  28. LAYOUT_moonlander_wrapper( \
  29. KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
  30. KC_TAB, K01, K02, K03, K04, K05, TG_DBLO,TG_DBLO, K06, K07, K08, K09, K0A, KC_BSLS, \
  31. KC_C1R3, K11, K12, K13, K14, K15, TG_GAME,TG_GAME, K16, K17, K18, K19, K1A, RALT_T(K1B), \
  32. KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A),KC_MRSF, \
  33. KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_NO, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \
  34. KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT \
  35. )
  36. #define LAYOUT_base_wrapper(...) LAYOUT_moonlander_base(__VA_ARGS__)
  37. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  38. [_DEFAULT_LAYER_1] = LAYOUT_base_wrapper(
  39. _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
  40. _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
  41. _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
  42. ),
  43. [_DEFAULT_LAYER_2] = LAYOUT_base_wrapper(
  44. ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
  45. ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
  46. ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
  47. ),
  48. [_DEFAULT_LAYER_3] = LAYOUT_base_wrapper(
  49. _________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
  50. _________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
  51. _________________COLEMAK_L3________________, _________________COLEMAK_R3________________
  52. ),
  53. [_DEFAULT_LAYER_4] = LAYOUT_base_wrapper(
  54. _________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
  55. _________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
  56. _________________DVORAK_L3_________________, _________________DVORAK_R3_________________
  57. ),
  58. [_GAMEPAD] = LAYOUT_moonlander_wrapper(
  59. KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, HYPR(KC_Q), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
  60. KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
  61. KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_TRNS, TG_GAME, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO,
  62. KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
  63. KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_PSCR, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO,
  64. KC_V, KC_SPC, KC_H, KC_NO, KC_NO, KC_SWAP_NUM
  65. ),
  66. [_DIABLO] = LAYOUT_moonlander_wrapper(
  67. KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
  68. KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
  69. KC_NO, KC_1, KC_2, KC_3, KC_4, KC_G, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
  70. KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO,
  71. KC_NO, KC_NO, KC_L, KC_J, KC_F, KC_PSCR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
  72. KC_DIABLO_CLEAR, SFT_T(KC_SPACE), ALT_T(KC_Q), KC_PGDN, KC_DEL, KC_ENT
  73. ),
  74. [_LOWER] = LAYOUT_moonlander_wrapper(
  75. KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11,
  76. _______, _________________LOWER_L1__________________, _______, _______, _________________LOWER_R1__________________, KC_PIPE,
  77. _______, _________________LOWER_L2__________________, _______, _______, _________________LOWER_R2__________________, KC_DQUO,
  78. _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, KC_PSCR,
  79. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS,
  80. _______, _______, _______, _______, _______, _______
  81. ),
  82. [_RAISE] = LAYOUT_moonlander_wrapper(
  83. KC_F12, _________________FUNC_LEFT_________________, _______, _______, _________________FUNC_RIGHT________________, KC_F11,
  84. _______, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, KC_BSLS,
  85. _______, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_QUOT,
  86. _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, KC_PSCR,
  87. _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PAUS,
  88. _______, _______, _______, _______, _______, _______
  89. ),
  90. [_ADJUST] = LAYOUT_moonlander_wrapper(
  91. KC_MAKE, _________________FUNC_LEFT_________________, UC_MOD, KC_NUKE, _________________ADJUST_R1_________________, KC_RST,
  92. VRSN, _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, EEP_RST,
  93. _______, _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, RGB_IDL,
  94. KEYLOCK, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS,
  95. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS,
  96. _______, _______, _______, _______, _______, _______
  97. ),
  98. };
  99. /* Blank
  100. [_LAYER] = LAYOUT_moonlander_wrapper(
  101. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  102. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  103. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  104. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  105. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  106. _______, _______, _______, _______, _______, _______
  107. ),
  108. */
  109. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  110. switch (keycode) {
  111. case KC_1:
  112. if (layer_state_is(_GAMEPAD) && userspace_config.swapped_numbers) {
  113. if (record->event.pressed) {
  114. register_code(KC_2);
  115. } else {
  116. unregister_code(KC_2);
  117. }
  118. return false;
  119. }
  120. break;
  121. case KC_2:
  122. if (layer_state_is(_GAMEPAD) && userspace_config.swapped_numbers) {
  123. if (record->event.pressed) {
  124. register_code(KC_1);
  125. } else {
  126. unregister_code(KC_1);
  127. }
  128. return false;
  129. }
  130. break;
  131. case KC_SWAP_NUM:
  132. if (record->event.pressed) {
  133. userspace_config.swapped_numbers ^= 1;
  134. eeconfig_update_user(userspace_config.raw);
  135. unregister_code(KC_1);
  136. unregister_code(KC_2);
  137. }
  138. break;
  139. }
  140. return true;
  141. }
  142. #ifdef RGB_MATRIX_ENABLE
  143. void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
  144. if (layer_state_is(_GAMEPAD)) {
  145. RGB_MATRIX_INDICATOR_SET_COLOR(11, 0x00, 0xFF, 0x00); // Q
  146. RGB_MATRIX_INDICATOR_SET_COLOR(16, 0x00, 0xFF, 0xFF); // W
  147. RGB_MATRIX_INDICATOR_SET_COLOR(21, 0xFF, 0x00, 0x00); // E
  148. RGB_MATRIX_INDICATOR_SET_COLOR(26, 0xFF, 0x80, 0x00); // R
  149. RGB_MATRIX_INDICATOR_SET_COLOR(12, 0x00, 0xFF, 0xFF); // A
  150. RGB_MATRIX_INDICATOR_SET_COLOR(17, 0x00, 0xFF, 0xFF); // S
  151. RGB_MATRIX_INDICATOR_SET_COLOR(22, 0x00, 0xFF, 0xFF); // D
  152. RGB_MATRIX_INDICATOR_SET_COLOR(27, 0x7A, 0x00, 0xFF); // F
  153. RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 15 : 10), 0xFF, 0xFF, 0xFF); // 1
  154. RGB_MATRIX_INDICATOR_SET_COLOR((userspace_config.swapped_numbers ? 10 : 15), 0x00, 0xFF, 0x00); // 2
  155. RGB_MATRIX_INDICATOR_SET_COLOR(20, 0x7A, 0x00, 0xFF); // 3
  156. }
  157. if (userspace_config.rgb_layer_change) {
  158. switch (get_highest_layer(layer_state|default_layer_state)) {
  159. case _DEFAULT_LAYER_1:
  160. rgb_matrix_layer_helper(DEFAULT_LAYER_1_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  161. break;
  162. case _DEFAULT_LAYER_2:
  163. rgb_matrix_layer_helper(DEFAULT_LAYER_2_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  164. break;
  165. case _DEFAULT_LAYER_3:
  166. rgb_matrix_layer_helper(DEFAULT_LAYER_3_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  167. break;
  168. case _DEFAULT_LAYER_4:
  169. rgb_matrix_layer_helper(DEFAULT_LAYER_4_HSV, 0, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  170. break;
  171. case _GAMEPAD:
  172. rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  173. break;
  174. case _DIABLO:
  175. rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed * 8, LED_FLAG_MODIFIER, led_min, led_max);
  176. break;
  177. case _RAISE:
  178. rgb_matrix_layer_helper(HSV_YELLOW, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  179. break;
  180. case _LOWER:
  181. rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  182. break;
  183. case _ADJUST:
  184. rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER, led_min, led_max);
  185. break;
  186. }
  187. }
  188. }
  189. #endif
  190. #ifdef TAPPING_TERM_PER_KEY
  191. uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
  192. if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) {
  193. if (mod_config(keycode & 0xf) & MOD_MASK_ALT) {
  194. return (2 * TAPPING_TERM);
  195. }
  196. }
  197. return TAPPING_TERM;
  198. }
  199. #endif