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.

321 lines
13 KiB

[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
[Keymap] Update to Drashna Keymaps (#5594) * Start to standardize macro timer * Update Fractal layout Specifically, limit the RGB Lighting, since it's too many for the power, and only have the KITT annimation on the front * Update Iris keymap to use I2C for transport * Remove TAP_CODE_DELAY from keyboard in favor of global setting * Remove Woodpad Since it\'s no longer in my possession * Only enable LTO on AVR boards * Run matrix_scans while doing startup light * Run matrix_scan to get split keyboard code synced properly * Fix rgb mode * Remove custom debouncing settings * Make RGB Light Startup Animation optional * Fix opt def * Remove extra tap code delay value * Fix references to keebio boards * Add support for LP Iris keyboard * Add backlight code * Make startup animation optional * Update gitlab ci script * Remove port declaration * Revert avrgcc changes to gitlab ci file * Don't re-set mods * Remove MACRO_TIMER define * Add custom name for crkbd * Add name for Prime M pad * Add names for ortho 4x12 boards * Add some additional handling for rgb init * Change thumb clusters on ergodox * Switch Orthodox to I2C * Fix Space in ergodox keymap * Use OSL for ergodox layout * Ugh, can't find a good layout * Fix typo * Fix up animation startup * Cries in AVR * Fix makefiles for ergodox ez boards * Add support for "secret songs" in my userspace * Reset debounce to 5ms for Ergodox EZ * Fix gitlab CI yaml file * More crying in AVR * Cannot use rgb light and rgb matrix at the same time due to the WS2812 rgb matrix PR until the "Coexistance" PR is merged * Update ODox for split common and i2c * Add split config * Impement Split code * Add support for xscorpion OLED code * Add OLED display config * Fix OLED screen font * Get OLED set up in vertical mode * Remove old OLED code * add per key support for crkbd * Fix split changes * RGB Tweeaks * More OLED tweaks * Fix rotation stuff * Fix more OLED stuff * Remove custom Debounce from Ergodox layout since it's no longer needed
5 years ago
  1. #include QMK_KEYBOARD_H
  2. #include "drashna.h"
  3. extern keymap_config_t keymap_config;
  4. extern uint8_t is_master;
  5. #ifdef RGBLIGHT_ENABLE
  6. //Following line allows macro to read current RGB settings
  7. extern rgblight_config_t rgblight_config;
  8. #endif
  9. enum crkbd_keycodes {
  10. RGBRST = NEW_SAFE_RANGE
  11. };
  12. #define LAYOUT_crkbd_base( \
  13. K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
  14. K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
  15. K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
  16. ) \
  17. LAYOUT_wrapper( \
  18. KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
  19. KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
  20. OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
  21. KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI \
  22. )
  23. #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
  24. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  25. [_QWERTY] = LAYOUT_crkbd_base_wrapper(
  26. _________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
  27. _________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
  28. _________________QWERTY_L3_________________, _________________QWERTY_R3_________________
  29. ),
  30. [_COLEMAK] = LAYOUT_crkbd_base_wrapper(
  31. _________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
  32. _________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
  33. _________________COLEMAK_L3________________, _________________COLEMAK_R3________________
  34. ),
  35. [_DVORAK] = LAYOUT_crkbd_base_wrapper(
  36. _________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
  37. _________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
  38. _________________DVORAK_L3_________________, _________________DVORAK_R3_________________
  39. ),
  40. [_WORKMAN] = LAYOUT_crkbd_base_wrapper(
  41. _________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
  42. _________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
  43. _________________WORKMAN_L3________________, _________________WORKMAN_R3________________
  44. ),
  45. [_NORMAN] = LAYOUT_crkbd_base_wrapper(
  46. _________________NORMAN_L1_________________, _________________NORMAN_L1_________________,
  47. _________________NORMAN_L2_________________, _________________NORMAN_R2_________________,
  48. _________________NORMAN_L3_________________, _________________NORMAN_R3_________________
  49. ),
  50. [_MALTRON] = LAYOUT_crkbd_base_wrapper(
  51. _________________MALTRON_L1________________, _________________MALTRON_R1________________,
  52. _________________MALTRON_L2________________, _________________MALTRON_R2________________,
  53. _________________MALTRON_L3________________, _________________MALTRON_R3________________
  54. ),
  55. [_EUCALYN] = LAYOUT_crkbd_base_wrapper(
  56. _________________EUCALYN_L1________________, _________________EUCALYN_R1________________,
  57. _________________EUCALYN_L2________________, _________________EUCALYN_R2________________,
  58. _________________EUCALYN_L3________________, _________________EUCALYN_R3________________
  59. ),
  60. [_CARPLAX] = LAYOUT_crkbd_base_wrapper(
  61. _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________,
  62. _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________,
  63. _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________
  64. ),
  65. [_MODS] = LAYOUT_wrapper(
  66. _______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
  67. _______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
  68. KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT,
  69. _______, _______, _______, _______, _______, _______
  70. ),
  71. [_LOWER] = LAYOUT_wrapper(
  72. KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11,
  73. KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
  74. _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
  75. _______, _______, _______, _______, _______, _______
  76. ),
  77. [_RAISE] = LAYOUT_wrapper( \
  78. _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
  79. _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
  80. _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
  81. _______, _______, _______, _______, _______, _______
  82. ),
  83. [_ADJUST] = LAYOUT_wrapper( \
  84. KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
  85. VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
  86. _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY,
  87. _______, _______, _______, KC_NUKE, TG_MODS, _______
  88. )
  89. };
  90. void matrix_init_keymap(void) {
  91. #ifndef CONVERT_TO_PROTON_C
  92. setPinOutput(D5);
  93. writePinHigh(D5);
  94. setPinOutput(B0);
  95. writePinHigh(B0);
  96. #endif
  97. }
  98. #ifdef OLED_DRIVER_ENABLE
  99. oled_rotation_t oled_init_user(oled_rotation_t rotation) {
  100. if (is_master) {
  101. return OLED_ROTATION_270;
  102. } else {
  103. return rotation;
  104. }
  105. }
  106. void render_crkbd_logo(void) {
  107. static const char PROGMEM crkbd_logo[] = {
  108. 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
  109. 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
  110. 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
  111. 0};
  112. oled_write_P(crkbd_logo, false);
  113. }
  114. #define KEYLOG_LEN (int)(32 / OLED_FONT_WIDTH)
  115. char keylog_str[KEYLOG_LEN] = {};
  116. uint8_t keylogs_str_idx = 0;
  117. uint16_t log_timer = 0;
  118. const char code_to_name[60] = {
  119. ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
  120. 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
  121. 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
  122. '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
  123. 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
  124. '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
  125. void add_keylog(uint16_t keycode) {
  126. if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
  127. (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
  128. for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) {
  129. keylog_str[i] = keylog_str[i - 1];
  130. }
  131. if (keycode < 60) {
  132. keylog_str[0] = code_to_name[keycode];
  133. }
  134. keylog_str[KEYLOG_LEN] = 0;
  135. log_timer = timer_read();
  136. }
  137. void update_log(void) {
  138. if (timer_elapsed(log_timer) > 750) {
  139. add_keylog(0);
  140. }
  141. }
  142. bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
  143. if (record->event.pressed) { add_keylog(keycode); }
  144. return true;
  145. }
  146. void render_status(void) {
  147. oled_write_P(PSTR("Layer"), false);
  148. switch (biton32(layer_state)) {
  149. case 0:
  150. oled_write_P(PSTR("Base "), false);
  151. break;
  152. case _RAISE:
  153. oled_write_P(PSTR("Raise"), false);
  154. break;
  155. case _LOWER:
  156. oled_write_P(PSTR("Lower"), false);
  157. break;
  158. case _ADJUST:
  159. oled_write_P(PSTR("Adjst"), false);
  160. break;
  161. default:
  162. oled_write_P(PSTR("Unkn "), false);
  163. break;
  164. }
  165. oled_write_P(PSTR("Lyout"), false);
  166. switch (biton32(default_layer_state)) {
  167. case _QWERTY:
  168. oled_write_P(PSTR("QWRTY"), false);
  169. break;
  170. case _COLEMAK:
  171. oled_write_P(PSTR("COLMK"), false);
  172. break;
  173. case _DVORAK:
  174. oled_write_P(PSTR("DVRAK"), false);
  175. break;
  176. case _WORKMAN:
  177. oled_write_P(PSTR("WRKMN"), false);
  178. break;
  179. case _NORMAN:
  180. oled_write_P(PSTR("NORMN"), false);
  181. break;
  182. case _MALTRON:
  183. oled_write_P(PSTR("MLTRN"), false);
  184. break;
  185. case _EUCALYN:
  186. oled_write_P(PSTR("ECLYN"), false);
  187. break;
  188. case _CARPLAX:
  189. oled_write_P(PSTR("CRPLX"), false);
  190. break;
  191. }
  192. uint8_t modifiers = get_mods();
  193. uint8_t one_shot = get_oneshot_mods();
  194. oled_write_P(PSTR("Mods:"), false);
  195. oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false);
  196. oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false);
  197. oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false);
  198. oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false);
  199. oled_write_P(PSTR("BTMGK"), false);
  200. if (keymap_config.swap_lalt_lgui) {
  201. oled_write_P(PSTR(" Mac "), false);
  202. } else {
  203. oled_write_P(PSTR(" Win "), false);
  204. }
  205. uint8_t led_usb_state = host_keyboard_leds();
  206. oled_write_P(PSTR("Lock:"), false);
  207. oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false);
  208. oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false);
  209. oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false);
  210. oled_write(keylog_str, false);
  211. }
  212. void oled_task_user(void) {
  213. if (is_master) {
  214. render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
  215. } else {
  216. render_crkbd_logo();
  217. oled_scroll_left(); // Turns on scrolling
  218. }
  219. }
  220. void matrix_scan_keymap(void) { update_log(); }
  221. #endif
  222. uint16_t get_tapping_term(uint16_t keycode) {
  223. switch (keycode) {
  224. case ALT_T(KC_A):
  225. return TAPPING_TERM + 100;
  226. default:
  227. return TAPPING_TERM;
  228. }
  229. }
  230. #ifdef RGB_MATRIX_ENABLE
  231. void rgb_matrix_indicators_user(void) {
  232. if ( userspace_config.rgb_layer_change &&
  233. #ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
  234. !g_suspend_state &&
  235. #endif
  236. #if defined(RGBLIGHT_ENABLE)
  237. (!rgblight_config.enable && rgb_matrix_config.enable)
  238. #else
  239. rgb_matrix_config.enable
  240. #endif
  241. ) {
  242. switch (biton32(layer_state)) {
  243. case _MODS:
  244. rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break;
  245. case _GAMEPAD:
  246. rgb_matrix_layer_helper(0xFF, 0x80, 0x00, LED_FLAG_UNDERGLOW); break;
  247. case _DIABLO:
  248. rgb_matrix_layer_helper(0xFF, 0x00, 0x00, LED_FLAG_UNDERGLOW); break;
  249. case _RAISE:
  250. rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break;
  251. case _LOWER:
  252. rgb_matrix_layer_helper(0x00, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break;
  253. case _ADJUST:
  254. rgb_matrix_layer_helper(0xFF, 0x00, 0x00, LED_FLAG_UNDERGLOW); break;
  255. default:
  256. switch (biton32(default_layer_state)) {
  257. case _QWERTY:
  258. rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, LED_FLAG_UNDERGLOW); break;
  259. case _COLEMAK:
  260. rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, LED_FLAG_UNDERGLOW); break;
  261. case _DVORAK:
  262. rgb_matrix_layer_helper(0x00, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break;
  263. case _WORKMAN:
  264. rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, LED_FLAG_UNDERGLOW); break;
  265. case _NORMAN:
  266. rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, LED_FLAG_UNDERGLOW); break;
  267. case _MALTRON:
  268. rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, LED_FLAG_UNDERGLOW); break;
  269. case _EUCALYN:
  270. rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, LED_FLAG_UNDERGLOW); break;
  271. case _CARPLAX:
  272. rgb_matrix_layer_helper(0x00, 0x00, 0xFF, LED_FLAG_UNDERGLOW); break;
  273. }
  274. }
  275. }
  276. }
  277. #endif