diff options
25 files changed, 576 insertions, 112 deletions
diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index adfd79044..cbc3feeb6 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h | |||
| @@ -41,5 +41,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 41 | #define RGBLIGHT_HUE_STEP 8 | 41 | #define RGBLIGHT_HUE_STEP 8 |
| 42 | #define RGBLIGHT_SAT_STEP 8 | 42 | #define RGBLIGHT_SAT_STEP 8 |
| 43 | #define RGBLIGHT_VAL_STEP 8 | 43 | #define RGBLIGHT_VAL_STEP 8 |
| 44 | #define RGBLIGHT_LIMIT_VAL 120 | 44 | #define RGBLIGHT_LIMIT_VAL 100 |
| 45 | #endif | ||
| 46 | |||
| 47 | #ifdef AUDIO_ENABLE | ||
| 48 | #define B6_AUDIO | ||
| 49 | // #define NO_MUSIC_MODE | ||
| 45 | #endif | 50 | #endif |
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 99dcdb4e1..282ee2572 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c | |||
| @@ -26,10 +26,10 @@ enum crkbd_keycodes { | |||
| 26 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ | 26 | K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ |
| 27 | ) \ | 27 | ) \ |
| 28 | LAYOUT_wrapper( \ | 28 | LAYOUT_wrapper( \ |
| 29 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ | 29 | KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ |
| 30 | KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 30 | KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ |
| 31 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ | 31 | OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ |
| 32 | LT(_LOWER,KC_GRV), KC_SPC, LALT_T(KC_BSPC), KC_DEL, KC_ENT, RAISE \ | 32 | LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ |
| 33 | ) | 33 | ) |
| 34 | #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) | 34 | #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) |
| 35 | 35 | ||
| @@ -66,14 +66,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 66 | ), | 66 | ), |
| 67 | 67 | ||
| 68 | [_LOWER] = LAYOUT_wrapper( | 68 | [_LOWER] = LAYOUT_wrapper( |
| 69 | KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, | 69 | KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, |
| 70 | KC_F11, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, | 70 | KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, |
| 71 | KC_F12, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, | 71 | _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, |
| 72 | _______, _______, _______, _______, _______, _______ | 72 | _______, _______, _______, _______, _______, _______ |
| 73 | ), | 73 | ), |
| 74 | 74 | ||
| 75 | [_RAISE] = LAYOUT_wrapper( \ | 75 | [_RAISE] = LAYOUT_wrapper( \ |
| 76 | KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, | 76 | _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, |
| 77 | _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, | 77 | _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, |
| 78 | _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, | 78 | _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, |
| 79 | _______, _______, _______, _______, _______, _______ | 79 | _______, _______, _______, _______, _______, _______ |
| @@ -81,18 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 81 | 81 | ||
| 82 | [_ADJUST] = LAYOUT_wrapper( \ | 82 | [_ADJUST] = LAYOUT_wrapper( \ |
| 83 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, | 83 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, |
| 84 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, | 84 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, |
| 85 | TG_MODS, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, | 85 | _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, |
| 86 | _______, _______, _______, _______, _______, _______ | 86 | _______, _______, _______, KC_NUKE, TG_MODS, _______ |
| 87 | ) | 87 | ) |
| 88 | }; | 88 | }; |
| 89 | 89 | ||
| 90 | int RGB_current_mode; | ||
| 91 | |||
| 92 | void matrix_init_keymap(void) { | 90 | void matrix_init_keymap(void) { |
| 93 | #ifdef RGBLIGHT_ENABLE | ||
| 94 | RGB_current_mode = rgblight_config.mode; | ||
| 95 | #endif | ||
| 96 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | 91 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h |
| 97 | #ifdef SSD1306OLED | 92 | #ifdef SSD1306OLED |
| 98 | iota_gfx_init(!has_usb()); // turns on the display | 93 | iota_gfx_init(!has_usb()); // turns on the display |
| @@ -102,53 +97,118 @@ void matrix_init_keymap(void) { | |||
| 102 | PORTD &= ~(1<<5); | 97 | PORTD &= ~(1<<5); |
| 103 | 98 | ||
| 104 | DDRB &= ~(1<<0); | 99 | DDRB &= ~(1<<0); |
| 105 | PORTB &= ~(1<<0);} | 100 | PORTB &= ~(1<<0); |
| 101 | } | ||
| 106 | 102 | ||
| 107 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | 103 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h |
| 108 | #ifdef SSD1306OLED | 104 | #ifdef SSD1306OLED |
| 109 | 105 | ||
| 110 | // When add source files to SRC in rules.mk, you can use functions. | 106 | // When add source files to SRC in rules.mk, you can use functions. |
| 111 | const char *read_layer_state(void); | ||
| 112 | const char *read_logo(void); | 107 | const char *read_logo(void); |
| 113 | void set_keylog(uint16_t keycode, keyrecord_t *record); | ||
| 114 | const char *read_keylog(void); | ||
| 115 | const char *read_keylogs(void); | ||
| 116 | char layer_state_str[24]; | 108 | char layer_state_str[24]; |
| 109 | char modifier_state_str[24]; | ||
| 110 | char host_led_state_str[24]; | ||
| 111 | char keylog_str[24] = {}; | ||
| 112 | char keylogs_str[21] = {}; | ||
| 113 | int keylogs_str_idx = 0; | ||
| 114 | |||
| 117 | // const char *read_mode_icon(bool swap); | 115 | // const char *read_mode_icon(bool swap); |
| 118 | const char *read_host_led_state(void); | ||
| 119 | // void set_timelog(void); | 116 | // void set_timelog(void); |
| 120 | // const char *read_timelog(void); | 117 | // const char *read_timelog(void); |
| 121 | 118 | ||
| 119 | const char code_to_name[60] = { | ||
| 120 | ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', | ||
| 121 | 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', | ||
| 122 | 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | ||
| 123 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', | ||
| 124 | 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', | ||
| 125 | '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | ||
| 126 | |||
| 127 | void set_keylog(uint16_t keycode, keyrecord_t *record) { | ||
| 128 | char name = ' '; | ||
| 129 | if (keycode < 60) { | ||
| 130 | name = code_to_name[keycode]; | ||
| 131 | } | ||
| 132 | |||
| 133 | // update keylog | ||
| 134 | snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", | ||
| 135 | record->event.key.row, record->event.key.col, | ||
| 136 | keycode, name); | ||
| 137 | |||
| 138 | // update keylogs | ||
| 139 | if (keylogs_str_idx == sizeof(keylogs_str) - 1) { | ||
| 140 | keylogs_str_idx = 0; | ||
| 141 | for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { | ||
| 142 | keylogs_str[i] = ' '; | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | keylogs_str[keylogs_str_idx] = name; | ||
| 147 | keylogs_str_idx++; | ||
| 148 | } | ||
| 149 | |||
| 150 | const char *read_keylog(void) { | ||
| 151 | return keylog_str; | ||
| 152 | } | ||
| 153 | |||
| 154 | const char *read_keylogs(void) { | ||
| 155 | return keylogs_str; | ||
| 156 | } | ||
| 157 | |||
| 158 | |||
| 159 | const char* read_modifier_state(void) { | ||
| 160 | uint8_t modifiers = get_mods(); | ||
| 161 | uint8_t one_shot = get_oneshot_mods(); | ||
| 162 | |||
| 163 | snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", | ||
| 164 | (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL" : " ", | ||
| 165 | (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI" : " ", | ||
| 166 | (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT" : " ", | ||
| 167 | (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : " " | ||
| 168 | ); | ||
| 169 | |||
| 170 | return modifier_state_str; | ||
| 171 | } | ||
| 172 | |||
| 173 | const char *read_host_led_state(void) { | ||
| 174 | uint8_t leds = host_keyboard_leds(); | ||
| 175 | |||
| 176 | snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", | ||
| 177 | (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", | ||
| 178 | (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", | ||
| 179 | (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- " | ||
| 180 | ); | ||
| 181 | |||
| 182 | return host_led_state_str; | ||
| 183 | } | ||
| 122 | 184 | ||
| 123 | const char* read_layer_state(void) { | 185 | const char* read_layer_state(void) { |
| 124 | switch (layer_state) { | 186 | switch (biton32(layer_state)) { |
| 125 | case _QWERTY: | 187 | case _RAISE: |
| 126 | switch (default_layer_state) { | 188 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise "); |
| 189 | break; | ||
| 190 | case _LOWER: | ||
| 191 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower "); | ||
| 192 | break; | ||
| 193 | case _ADJUST: | ||
| 194 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust "); | ||
| 195 | break; | ||
| 196 | default: | ||
| 197 | switch (biton32(default_layer_state)) { | ||
| 127 | case _QWERTY: | 198 | case _QWERTY: |
| 128 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY"); | 199 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty "); |
| 129 | break; | 200 | break; |
| 130 | case _COLEMAK: | 201 | case _COLEMAK: |
| 131 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); | 202 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); |
| 132 | break; | 203 | break; |
| 133 | case _DVORAK: | 204 | case _DVORAK: |
| 134 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); | 205 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak "); |
| 135 | break; | 206 | break; |
| 136 | case _WORKMAN: | 207 | case _WORKMAN: |
| 137 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); | 208 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); |
| 138 | break; | 209 | break; |
| 139 | } | 210 | } |
| 140 | break; | 211 | break; |
| 141 | case _RAISE: | ||
| 142 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); | ||
| 143 | break; | ||
| 144 | case _LOWER: | ||
| 145 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); | ||
| 146 | break; | ||
| 147 | case _ADJUST: | ||
| 148 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); | ||
| 149 | break; | ||
| 150 | default: | ||
| 151 | snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); | ||
| 152 | } | 212 | } |
| 153 | 213 | ||
| 154 | return layer_state_str; | 214 | return layer_state_str; |
| @@ -160,12 +220,13 @@ void matrix_scan_keymap(void) { | |||
| 160 | 220 | ||
| 161 | void matrix_render_user(struct CharacterMatrix *matrix) { | 221 | void matrix_render_user(struct CharacterMatrix *matrix) { |
| 162 | if (is_master) { | 222 | if (is_master) { |
| 163 | // If you want to change the display of OLED, you need to change here | 223 | //If you want to change the display of OLED, you need to change here |
| 164 | matrix_write_ln(matrix, read_layer_state()); | 224 | matrix_write_ln(matrix, read_layer_state()); |
| 165 | matrix_write_ln(matrix, read_keylog()); | 225 | matrix_write_ln(matrix, read_modifier_state()); |
| 226 | // matrix_write_ln(matrix, read_keylog()); | ||
| 166 | matrix_write_ln(matrix, read_keylogs()); | 227 | matrix_write_ln(matrix, read_keylogs()); |
| 167 | //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); | 228 | // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); |
| 168 | matrix_write_ln(matrix, read_host_led_state()); | 229 | matrix_write(matrix, read_host_led_state()); |
| 169 | //matrix_write_ln(matrix, read_timelog()); | 230 | //matrix_write_ln(matrix, read_timelog()); |
| 170 | } else { | 231 | } else { |
| 171 | matrix_write(matrix, read_logo()); | 232 | matrix_write(matrix, read_logo()); |
| @@ -187,8 +248,14 @@ void iota_gfx_task_user(void) { | |||
| 187 | } | 248 | } |
| 188 | 249 | ||
| 189 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | 250 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { |
| 190 | if (record->event.pressed) { | 251 | switch (keycode) { |
| 191 | set_keylog(keycode, record); | 252 | case KC_A ... KC_SLASH: |
| 253 | case KC_F1 ... KC_F12: | ||
| 254 | case KC_INSERT ... KC_UP: | ||
| 255 | case KC_KP_SLASH ... KC_KP_DOT: | ||
| 256 | case KC_F13 ... KC_F24: | ||
| 257 | if (record->event.pressed) { set_keylog(keycode, record); } | ||
| 258 | break; | ||
| 192 | // set_timelog(); | 259 | // set_timelog(); |
| 193 | } | 260 | } |
| 194 | return true; | 261 | return true; |
diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index ccf8e2b7c..4b70f66f7 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk | |||
| @@ -20,12 +20,14 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing | |||
| 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 20 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 21 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 22 | 22 | ||
| 23 | BOOTLOADER = qmk-dfu | ||
| 24 | |||
| 23 | # If you want to change the display of OLED, you need to change here | 25 | # If you want to change the display of OLED, you need to change here |
| 24 | SRC += ./lib/glcdfont.c \ | 26 | SRC += ./lib/glcdfont.c \ |
| 25 | ./lib/rgb_state_reader.c \ | 27 | ./lib/rgb_state_reader.c \ |
| 26 | ./lib/logo_reader.c \ | 28 | ./lib/logo_reader.c \ |
| 27 | ./lib/keylogger.c \ | 29 | # ./lib/keylogger.c \ |
| 28 | ./lib/host_led_state_reader.c \ | 30 | # ./lib/host_led_state_reader.c \ |
| 29 | # ./lib/layer_state_reader.c \ | ||
| 30 | # ./lib/mode_icon_reader.c \ | 31 | # ./lib/mode_icon_reader.c \ |
| 32 | # ./lib/layer_state_reader.c \ | ||
| 31 | # ./lib/timelogger.c \ | 33 | # ./lib/timelogger.c \ |
diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index 21e3151c0..ba6f18edd 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c | |||
| @@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 79 | 79 | ||
| 80 | [_ADJUST] = LAYOUT_wrapper( | 80 | [_ADJUST] = LAYOUT_wrapper( |
| 81 | KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, | 81 | KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, |
| 82 | VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EPRM, | 82 | VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EEP_RST, |
| 83 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, | 83 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, |
| 84 | _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, | 84 | _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, |
| 85 | _______, _______, _______, _______, _______, _______ | 85 | _______, _______, _______, _______, _______, _______ |
diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk index 89e568f39..ccc33c06f 100644 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ b/keyboards/iris/keymaps/drashna/rules.mk | |||
| @@ -8,7 +8,7 @@ RGBLIGHT_ENABLE = yes | |||
| 8 | AUDIO_ENABLE = yes | 8 | AUDIO_ENABLE = yes |
| 9 | NKRO_ENABLE = yes | 9 | NKRO_ENABLE = yes |
| 10 | BACKLIGHT_ENABLE = no | 10 | BACKLIGHT_ENABLE = no |
| 11 | SWAP_HANDS_ENABLE = yes | 11 | SWAP_HANDS_ENABLE = no |
| 12 | 12 | ||
| 13 | INDICATOR_LIGHTS = yes | 13 | INDICATOR_LIGHTS = yes |
| 14 | MACROS_ENABLED = no | 14 | MACROS_ENABLED = no |
diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 545ad25dc..346ca4f12 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c | |||
| @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 91 | 91 | ||
| 92 | [_ADJUST] = LAYOUT_wrapper(\ | 92 | [_ADJUST] = LAYOUT_wrapper(\ |
| 93 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, | 93 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, |
| 94 | VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EPRM, | 94 | VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, |
| 95 | TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY | 95 | TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY |
| 96 | ) | 96 | ) |
| 97 | }; | 97 | }; |
diff --git a/keyboards/quefrency/keymaps/bjohnson/config.h b/keyboards/quefrency/keymaps/bjohnson/config.h new file mode 100644 index 000000000..37c6d6672 --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/config.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | /* | ||
| 2 | This is the c configuration file for the keymap | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | Copyright 2018 Danny Nguyen <danny@keeb.io> | ||
| 7 | |||
| 8 | This program is free software: you can redistribute it and/or modify | ||
| 9 | it under the terms of the GNU General Public License as published by | ||
| 10 | the Free Software Foundation, either version 2 of the License, or | ||
| 11 | (at your option) any later version. | ||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, | ||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | GNU General Public License for more details. | ||
| 17 | |||
| 18 | You should have received a copy of the GNU General Public License | ||
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #pragma once | ||
| 23 | |||
| 24 | /* Use I2C or Serial, not both */ | ||
| 25 | |||
| 26 | #define USE_SERIAL | ||
| 27 | // #define USE_I2C | ||
| 28 | |||
| 29 | #define TAPPING_TERM 500 | ||
| 30 | |||
| 31 | #define IGNORE_MOD_TAP_INTERRUPT | ||
| 32 | #define PERMISSIVE_HOLD | ||
| 33 | #define FORCE_NKRO | ||
| 34 | #define RETRO_TAPPING | ||
| 35 | |||
| 36 | #define TAPPING_TOGGLE 1 | ||
| 37 | |||
| 38 | #define NO_ACTION_MACRO | ||
| 39 | #define NO_ACTION_FUNCTION | ||
| 40 | |||
| 41 | #define RGBLIGHT_SLEEP | ||
diff --git a/keyboards/quefrency/keymaps/bjohnson/keymap.c b/keyboards/quefrency/keymaps/bjohnson/keymap.c new file mode 100644 index 000000000..434a0a305 --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/keymap.c | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | extern keymap_config_t keymap_config; | ||
| 4 | |||
| 5 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 6 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 7 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 8 | // entirely and just use numbers. | ||
| 9 | #define _BASE 0 | ||
| 10 | #define _FN1 1 | ||
| 11 | |||
| 12 | enum custom_keycodes { | ||
| 13 | QWERTY = SAFE_RANGE, | ||
| 14 | }; | ||
| 15 | |||
| 16 | |||
| 17 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 18 | [_BASE] = LAYOUT_65( | ||
| 19 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_HOME, \ | ||
| 20 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ | ||
| 21 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_DEL, \ | ||
| 22 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_INS, \ | ||
| 23 | KC_LCTL, KC_LGUI, KC_LALT, LT(_FN1,KC_SPC),KC_SPC, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, XXXXXXX, KC_APP, KC_RCTL, TT(_FN1) | ||
| 24 | ), | ||
| 25 | |||
| 26 | [_FN1] = LAYOUT_65( | ||
| 27 | KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_BSPC, KC_PGUP, \ | ||
| 28 | _______, _______, KC_UP, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, KC_PGDN, \ | ||
| 29 | _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, \ | ||
| 30 | _______, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, \ | ||
| 31 | _______, _______, _______, _______, _______, KC_P0, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______ | ||
| 32 | ) | ||
| 33 | }; | ||
diff --git a/keyboards/quefrency/keymaps/bjohnson/rules.mk b/keyboards/quefrency/keymaps/bjohnson/rules.mk new file mode 100644 index 000000000..70fa71100 --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | BOOTLOADER = atmel-dfu | ||
| 2 | |||
| 3 | # Build Options | ||
| 4 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 5 | # the appropriate keymap folder that will get included automatically | ||
| 6 | # | ||
| 7 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) | ||
| 8 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | ||
| 9 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 10 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 11 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 12 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 14 | MIDI_ENABLE = no # MIDI controls | ||
| 15 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 16 | UNICODE_ENABLE = yes # Unicode | ||
| 17 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 18 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. | ||
| 19 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 20 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 21 | |||
| 22 | SPLIT_KEYBOARD = yes | ||
diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index acda8a0d2..a34320519 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c | |||
| @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 60 | 60 | ||
| 61 | [_MEDIA] = LAYOUT_ortho_5x7( | 61 | [_MEDIA] = LAYOUT_ortho_5x7( |
| 62 | KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, | 62 | KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, |
| 63 | MEDIA, EPRM, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, | 63 | MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, |
| 64 | RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, | 64 | RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, |
| 65 | KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, | 65 | KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, |
| 66 | KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI | 66 | KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI |
| @@ -94,5 +94,3 @@ void matrix_init_keymap(void) { | |||
| 94 | DDRB &= ~(1<<0); | 94 | DDRB &= ~(1<<0); |
| 95 | PORTB &= ~(1<<0); | 95 | PORTB &= ~(1<<0); |
| 96 | } | 96 | } |
| 97 | |||
| 98 | |||
diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 360a2d9c6..df9be62b7 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c | |||
| @@ -20,8 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 20 | #ifdef UNICODEMAP_ENABLE | 20 | #ifdef UNICODEMAP_ENABLE |
| 21 | #include "drashna_unicode.h" | 21 | #include "drashna_unicode.h" |
| 22 | #endif // UNICODEMAP_ENABLE | 22 | #endif // UNICODEMAP_ENABLE |
| 23 | extern uint8_t input_mode; | ||
| 23 | 24 | ||
| 24 | 25 | #ifdef RGB_MATRIX_ENABLE | |
| 26 | extern bool g_suspend_state; | ||
| 27 | extern rgb_config_t rgb_matrix_config; | ||
| 28 | #endif | ||
| 29 | extern userspace_config_t userspace_config; | ||
| 25 | 30 | ||
| 26 | //enum more_custom_keycodes { | 31 | //enum more_custom_keycodes { |
| 27 | // KC_P00 = NEW_SAFE_RANGE | 32 | // KC_P00 = NEW_SAFE_RANGE |
| @@ -40,7 +45,7 @@ bool skip_leds = false; | |||
| 40 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ | 45 | KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ |
| 41 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ | 46 | KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ |
| 42 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ | 47 | KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ |
| 43 | KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_SHRG, \ | 48 | KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ |
| 44 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ | 49 | OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ |
| 45 | KC_HOME, KC_PGUP, \ | 50 | KC_HOME, KC_PGUP, \ |
| 46 | LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ | 51 | LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ |
| @@ -198,7 +203,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 198 | */ | 203 | */ |
| 199 | [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( | 204 | [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( |
| 200 | KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, | 205 | KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, |
| 201 | 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, | 206 | 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, |
| 202 | KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, | 207 | KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, |
| 203 | KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, | 208 | KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, |
| 204 | KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, | 209 | KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, |
| @@ -263,7 +268,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 263 | 268 | ||
| 264 | [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( | 269 | [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( |
| 265 | KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, | 270 | KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, |
| 266 | VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EPRM, | 271 | VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, |
| 267 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), | 272 | _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), |
| 268 | _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, | 273 | _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, |
| 269 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 274 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| @@ -290,10 +295,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | |||
| 290 | return true; | 295 | return true; |
| 291 | } | 296 | } |
| 292 | 297 | ||
| 293 | void matrix_init_keymap(void) { // Runs boot tasks for keyboard | ||
| 294 | }; | ||
| 295 | |||
| 296 | |||
| 297 | void matrix_scan_keymap(void) { // runs frequently to update info | 298 | void matrix_scan_keymap(void) { // runs frequently to update info |
| 298 | uint8_t modifiers = get_mods(); | 299 | uint8_t modifiers = get_mods(); |
| 299 | uint8_t led_usb_state = host_keyboard_leds(); | 300 | uint8_t led_usb_state = host_keyboard_leds(); |
| @@ -335,3 +336,106 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) { | |||
| 335 | return false; | 336 | return false; |
| 336 | } | 337 | } |
| 337 | } | 338 | } |
| 339 | |||
| 340 | |||
| 341 | #ifdef RGB_MATRIX_ENABLE | ||
| 342 | |||
| 343 | void suspend_power_down_keymap(void) { | ||
| 344 | rgb_matrix_set_suspend_state(true); | ||
| 345 | rgb_matrix_config.enable = false; | ||
| 346 | } | ||
| 347 | |||
| 348 | void suspend_wakeup_init_keymap(void) { | ||
| 349 | rgb_matrix_config.enable = true; | ||
| 350 | rgb_matrix_set_suspend_state(false); | ||
| 351 | } | ||
| 352 | |||
| 353 | void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { | ||
| 354 | rgb_led led; | ||
| 355 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | ||
| 356 | led = g_rgb_leds[i]; | ||
| 357 | if (led.matrix_co.raw < 0xFF) { | ||
| 358 | if (led.modifier) { | ||
| 359 | rgb_matrix_set_color( i, red, green, blue ); | ||
| 360 | } | ||
| 361 | } | ||
| 362 | } | ||
| 363 | } | ||
| 364 | |||
| 365 | void rgb_matrix_indicators_user(void) { | ||
| 366 | if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) return; | ||
| 367 | |||
| 368 | switch (biton32(layer_state)) { | ||
| 369 | case _MODS: | ||
| 370 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 371 | case _GAMEPAD: | ||
| 372 | rgb_matrix_layer_helper(0xFF, 0x80, 0x00); | ||
| 373 | rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q | ||
| 374 | rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W | ||
| 375 | rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E | ||
| 376 | rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R | ||
| 377 | rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A | ||
| 378 | rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S | ||
| 379 | rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D | ||
| 380 | rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F | ||
| 381 | |||
| 382 | rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 | ||
| 383 | rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 | ||
| 384 | rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 | ||
| 385 | |||
| 386 | break; | ||
| 387 | case _DIABLO: | ||
| 388 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 389 | case _RAISE: | ||
| 390 | rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; | ||
| 391 | case _LOWER: | ||
| 392 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 393 | case _ADJUST: | ||
| 394 | rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; | ||
| 395 | default: | ||
| 396 | switch (biton32(default_layer_state)) { | ||
| 397 | case _QWERTY: | ||
| 398 | rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; | ||
| 399 | case _COLEMAK: | ||
| 400 | rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; | ||
| 401 | case _DVORAK: | ||
| 402 | rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; | ||
| 403 | case _WORKMAN: | ||
| 404 | rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; | ||
| 405 | } | ||
| 406 | } | ||
| 407 | #if 0 | ||
| 408 | if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { | ||
| 409 | rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); | ||
| 410 | rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); | ||
| 411 | } | ||
| 412 | if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { | ||
| 413 | rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); | ||
| 414 | rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); | ||
| 415 | rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); | ||
| 416 | |||
| 417 | } | ||
| 418 | if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { | ||
| 419 | rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); | ||
| 420 | } | ||
| 421 | if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { | ||
| 422 | rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); | ||
| 423 | } | ||
| 424 | #endif | ||
| 425 | } | ||
| 426 | |||
| 427 | void matrix_init_keymap(void) { | ||
| 428 | #ifdef RGB_MATRIX_KEYPRESSES | ||
| 429 | rgblight_mode(RGB_MATRIX_MULTISPLASH); | ||
| 430 | #else | ||
| 431 | rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); | ||
| 432 | #endif | ||
| 433 | |||
| 434 | input_mode = 2; | ||
| 435 | } | ||
| 436 | |||
| 437 | #else | ||
| 438 | void matrix_init_keymap(void) { | ||
| 439 | input_mode = 2; | ||
| 440 | } | ||
| 441 | #endif //RGB_MATRIX_INIT | ||
diff --git a/layouts/community/ergodox/drashna_glow/README.md b/layouts/community/ergodox/drashna_glow/README.md new file mode 100644 index 000000000..7d625a258 --- /dev/null +++ b/layouts/community/ergodox/drashna_glow/README.md | |||
| @@ -0,0 +1 @@ | |||
| Note: This board will not flash if the "g_rgb_leds" const is not set to weak in the ergodox_ez.c file | |||
diff --git a/layouts/community/ergodox/drashna_glow/config.h b/layouts/community/ergodox/drashna_glow/config.h new file mode 100644 index 000000000..197acbc4a --- /dev/null +++ b/layouts/community/ergodox/drashna_glow/config.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "../drashna/config.h" | ||
| 4 | |||
| 5 | #undef PRODUCT | ||
| 6 | #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Glow | ||
| 7 | |||
| 8 | #undef DEBOUNCE | ||
| 9 | #define DEBOUNCE 5 | ||
| 10 | |||
| 11 | // #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) | ||
diff --git a/layouts/community/ergodox/drashna_glow/keymap.c b/layouts/community/ergodox/drashna_glow/keymap.c new file mode 100644 index 000000000..f2fb66545 --- /dev/null +++ b/layouts/community/ergodox/drashna_glow/keymap.c | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* placeholder file */ | ||
| 2 | #include QMK_KEYBOARD_H | ||
| 3 | |||
| 4 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | ||
| 5 | |||
| 6 | /*{row | col << 4} | ||
| 7 | | {x=0..224, y=0..64} | ||
| 8 | | | modifier | ||
| 9 | | | | */ | ||
| 10 | {{0|(0<<4)}, {24.9*5, 16*0}, 0}, // LED 1 on right | ||
| 11 | {{0|(1<<4)}, {24.9*6, 16*0}, 0}, // LED 2 | ||
| 12 | {{0|(2<<4)}, {24.9*7, 16*0}, 0}, // LED 3 | ||
| 13 | {{0|(3<<4)}, {24.9*8, 16*0}, 0}, // LED 4 | ||
| 14 | {{0|(4<<4)}, {24.9*9, 16*0}, 0}, // LED 5 | ||
| 15 | |||
| 16 | {{1|(5<<4)}, {24.9*5, 16*1}, 0}, // LED 6 | ||
| 17 | {{1|(6<<4)}, {24.9*6, 16*1}, 0}, // LED 7 | ||
| 18 | {{1|(7<<4)}, {24.9*7, 16*1}, 0}, // LED 8 | ||
| 19 | {{1|(8<<4)}, {24.9*8, 16*1}, 0}, // LED 9 | ||
| 20 | {{1|(9<<4)}, {24.9*9, 16*1}, 0}, // LED 10 | ||
| 21 | |||
| 22 | {{2|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 11 | ||
| 23 | {{2|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 12 | ||
| 24 | {{2|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 13 | ||
| 25 | {{2|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 14 | ||
| 26 | {{2|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 15 | ||
| 27 | |||
| 28 | {{3|(5<<4)}, {24.9*5, 16*2}, 0}, // LED 16 | ||
| 29 | {{3|(6<<4)}, {24.9*6, 16*2}, 0}, // LED 17 | ||
| 30 | {{3|(7<<4)}, {24.9*7, 16*2}, 0}, // LED 18 | ||
| 31 | {{3|(8<<4)}, {24.9*8, 16*2}, 0}, // LED 19 | ||
| 32 | {{3|(9<<4)}, {24.9*9, 16*2}, 0}, // LED 20 | ||
| 33 | |||
| 34 | {{4|(6<<4)}, {24.9*6, 16*2}, 1}, // LED 21 | ||
| 35 | {{4|(7<<4)}, {24.9*7, 16*2}, 1}, // LED 22 | ||
| 36 | {{4|(8<<4)}, {24.9*8, 16*2}, 1}, // LED 23 | ||
| 37 | {{4|(9<<4)}, {24.9*9, 16*2}, 1}, // LED 24 | ||
| 38 | |||
| 39 | {{0|(0<<4)}, {24.9*4, 16*0}, 0}, // LED 1 on left | ||
| 40 | {{0|(1<<4)}, {24.9*3, 16*0}, 0}, // LED 2 | ||
| 41 | {{0|(2<<4)}, {24.9*2, 16*0}, 0}, // LED 3 | ||
| 42 | {{0|(3<<4)}, {24.9*1, 16*0}, 0}, // LED 4 | ||
| 43 | {{0|(4<<4)}, {24.9*0, 16*0}, 0}, // LED 5 | ||
| 44 | |||
| 45 | {{1|(5<<4)}, {24.9*4, 16*1}, 0}, // LED 6 | ||
| 46 | {{1|(6<<4)}, {24.9*3, 16*1}, 0}, // LED 7 | ||
| 47 | {{1|(7<<4)}, {24.9*2, 16*1}, 0}, // LED 8 | ||
| 48 | {{1|(8<<4)}, {24.9*1, 16*1}, 0}, // LED 9 | ||
| 49 | {{1|(9<<4)}, {24.9*0, 16*1}, 0}, // LED 10 | ||
| 50 | |||
| 51 | {{2|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 11 | ||
| 52 | {{2|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 12 | ||
| 53 | {{2|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 13 | ||
| 54 | {{2|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 14 | ||
| 55 | {{2|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 15 | ||
| 56 | |||
| 57 | {{3|(5<<4)}, {24.9*4, 16*2}, 0}, // LED 16 | ||
| 58 | {{3|(6<<4)}, {24.9*3, 16*2}, 0}, // LED 17 | ||
| 59 | {{3|(7<<4)}, {24.9*2, 16*2}, 0}, // LED 18 | ||
| 60 | {{3|(8<<4)}, {24.9*1, 16*2}, 0}, // LED 19 | ||
| 61 | {{3|(9<<4)}, {24.9*0, 16*2}, 0}, // LED 20 | ||
| 62 | |||
| 63 | {{4|(6<<4)}, {24.9*3, 16*2}, 1}, // LED 21 | ||
| 64 | {{4|(7<<4)}, {24.9*2, 16*2}, 1}, // LED 22 | ||
| 65 | {{4|(8<<4)}, {24.9*1, 16*2}, 1}, // LED 23 | ||
| 66 | {{4|(9<<4)}, {24.9*0, 16*2}, 1}, // LED 24 | ||
| 67 | }; | ||
diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk new file mode 100644 index 000000000..3b317224a --- /dev/null +++ b/layouts/community/ergodox/drashna_glow/rules.mk | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | USER_NAME := drashna | ||
| 2 | SRC += ../drashna/keymap.c | ||
| 3 | |||
| 4 | -include $$(LAYOUT_KEYMAP_PATH)/../drashna/rules.mk | ||
| 5 | |||
| 6 | ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) | ||
| 7 | RGBLIGHT_ENABLE = no | ||
| 8 | RGB_MATRIX_ENABLE = yes | ||
| 9 | endif | ||
diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 2a9e32cc8..205d12d8c 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c | |||
| @@ -92,7 +92,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 92 | 92 | ||
| 93 | [_ADJUST] = LAYOUT_ortho_4x12_wrapper( | 93 | [_ADJUST] = LAYOUT_ortho_4x12_wrapper( |
| 94 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, | 94 | KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, |
| 95 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, | 95 | VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, |
| 96 | _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, | 96 | _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, |
| 97 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | 97 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
| 98 | ) | 98 | ) |
diff --git a/users/drashna/config.h b/users/drashna/config.h index 7e6a7d1c8..06cae86ab 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h | |||
| @@ -57,8 +57,10 @@ | |||
| 57 | #ifdef TAPPING_TERM | 57 | #ifdef TAPPING_TERM |
| 58 | #undef TAPPING_TERM | 58 | #undef TAPPING_TERM |
| 59 | #endif // TAPPING_TERM | 59 | #endif // TAPPING_TERM |
| 60 | #ifdef KEYBOARD_ergodox_ez | 60 | #if defined(KEYBOARD_ergodox_ez) |
| 61 | #define TAPPING_TERM 185 | 61 | #define TAPPING_TERM 185 |
| 62 | #elif defined(KEYBOARD_crkbd) | ||
| 63 | #define TAPPING_TERM 200 | ||
| 62 | #else | 64 | #else |
| 63 | #define TAPPING_TERM 175 | 65 | #define TAPPING_TERM 175 |
| 64 | #endif | 66 | #endif |
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 4111d2931..8f10a530e 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -173,12 +173,15 @@ void matrix_init_user(void) { | |||
| 173 | get_unicode_input_mode(); | 173 | get_unicode_input_mode(); |
| 174 | #endif //UNICODE_ENABLE | 174 | #endif //UNICODE_ENABLE |
| 175 | matrix_init_keymap(); | 175 | matrix_init_keymap(); |
| 176 | } | ||
| 177 | |||
| 178 | void startup_user (void) { | ||
| 179 | #ifdef RGBLIGHT_ENABLE | 176 | #ifdef RGBLIGHT_ENABLE |
| 180 | matrix_init_rgb(); | 177 | matrix_init_rgb(); |
| 181 | #endif //RGBLIGHT_ENABLE | 178 | #endif //RGBLIGHT_ENABLE |
| 179 | } | ||
| 180 | |||
| 181 | void startup_user (void) { | ||
| 182 | // #ifdef RGBLIGHT_ENABLE | ||
| 183 | // matrix_init_rgb(); | ||
| 184 | // #endif //RGBLIGHT_ENABLE | ||
| 182 | startup_keymap(); | 185 | startup_keymap(); |
| 183 | } | 186 | } |
| 184 | 187 | ||
| @@ -294,11 +297,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 294 | } | 297 | } |
| 295 | break; | 298 | break; |
| 296 | 299 | ||
| 297 | case EPRM: // Resets EEPROM | ||
| 298 | if (record->event.pressed) { | ||
| 299 | eeconfig_init(); | ||
| 300 | } | ||
| 301 | break; | ||
| 302 | case VRSN: // Prints firmware version | 300 | case VRSN: // Prints firmware version |
| 303 | if (record->event.pressed) { | 301 | if (record->event.pressed) { |
| 304 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); | 302 | send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); |
| @@ -392,7 +390,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 392 | #endif | 390 | #endif |
| 393 | } | 391 | } |
| 394 | return process_record_keymap(keycode, record) && | 392 | return process_record_keymap(keycode, record) && |
| 395 | #ifdef RGBLIGHT_ENABLE | 393 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 396 | process_record_user_rgb(keycode, record) && | 394 | process_record_user_rgb(keycode, record) && |
| 397 | #endif // RGBLIGHT_ENABLE | 395 | #endif // RGBLIGHT_ENABLE |
| 398 | process_record_secrets(keycode, record); | 396 | process_record_secrets(keycode, record); |
| @@ -413,7 +411,11 @@ uint32_t layer_state_set_user(uint32_t state) { | |||
| 413 | 411 | ||
| 414 | 412 | ||
| 415 | uint32_t default_layer_state_set_user(uint32_t state) { | 413 | uint32_t default_layer_state_set_user(uint32_t state) { |
| 416 | return default_layer_state_set_keymap(state); | 414 | state = default_layer_state_set_keymap(state); |
| 415 | #ifdef RGBLIGHT_ENABLE | ||
| 416 | state = default_layer_state_set_rgb(state); | ||
| 417 | #endif // RGBLIGHT_ENABLE | ||
| 418 | return state; | ||
| 417 | } | 419 | } |
| 418 | 420 | ||
| 419 | 421 | ||
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 573cb26fd..06e726714 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h | |||
| @@ -73,6 +73,8 @@ typedef union { | |||
| 73 | }; | 73 | }; |
| 74 | } userspace_config_t; | 74 | } userspace_config_t; |
| 75 | 75 | ||
| 76 | extern userspace_config_t userspace_config; | ||
| 77 | |||
| 76 | #if defined(KEYMAP_SAFE_RANGE) | 78 | #if defined(KEYMAP_SAFE_RANGE) |
| 77 | #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE | 79 | #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE |
| 78 | #else | 80 | #else |
| @@ -80,8 +82,7 @@ typedef union { | |||
| 80 | #endif | 82 | #endif |
| 81 | 83 | ||
| 82 | enum userspace_custom_keycodes { | 84 | enum userspace_custom_keycodes { |
| 83 | EPRM = PLACEHOLDER_SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) | 85 | VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info |
| 84 | VRSN, // Prints QMK Firmware and board info | ||
| 85 | KC_QWERTY, // Sets default layer to QWERTY | 86 | KC_QWERTY, // Sets default layer to QWERTY |
| 86 | KC_COLEMAK, // Sets default layer to COLEMAK | 87 | KC_COLEMAK, // Sets default layer to COLEMAK |
| 87 | KC_DVORAK, // Sets default layer to DVORAK | 88 | KC_DVORAK, // Sets default layer to DVORAK |
| @@ -159,6 +160,9 @@ enum userspace_custom_keycodes { | |||
| 159 | #define OS_RCTL OSM(MOD_RCTL) | 160 | #define OS_RCTL OSM(MOD_RCTL) |
| 160 | #define OS_LALT OSM(MOD_LALT) | 161 | #define OS_LALT OSM(MOD_LALT) |
| 161 | #define OS_RALT OSM(MOD_RALT) | 162 | #define OS_RALT OSM(MOD_RALT) |
| 163 | #define OS_MEH OSM(MOD_MEH) | ||
| 164 | #define OS_HYPR OSM(MOD_HYPR) | ||
| 165 | |||
| 162 | #define ALT_APP ALT_T(KC_APP) | 166 | #define ALT_APP ALT_T(KC_APP) |
| 163 | 167 | ||
| 164 | #define MG_NKRO MAGIC_TOGGLE_NKRO | 168 | #define MG_NKRO MAGIC_TOGGLE_NKRO |
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index b6de4d39e..d238c2065 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c | |||
| @@ -2,8 +2,11 @@ | |||
| 2 | #include "rgb_stuff.h" | 2 | #include "rgb_stuff.h" |
| 3 | #include "eeprom.h" | 3 | #include "eeprom.h" |
| 4 | 4 | ||
| 5 | #if defined(RGBLIGHT_ENABLE) | ||
| 5 | extern rgblight_config_t rgblight_config; | 6 | extern rgblight_config_t rgblight_config; |
| 6 | extern userspace_config_t userspace_config; | 7 | #elif defined(RGB_MATRIX_ENABLE) |
| 8 | extern rgb_config_t rgb_matrix_config; | ||
| 9 | #endif | ||
| 7 | 10 | ||
| 8 | #ifdef RGBLIGHT_ENABLE | 11 | #ifdef RGBLIGHT_ENABLE |
| 9 | void rgblight_sethsv_default_helper(uint8_t index) { | 12 | void rgblight_sethsv_default_helper(uint8_t index) { |
| @@ -209,7 +212,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 209 | return true; break; | 212 | return true; break; |
| 210 | #endif // RGBLIGHT_TWINKLE | 213 | #endif // RGBLIGHT_TWINKLE |
| 211 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal | 214 | case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal |
| 212 | #ifdef RGBLIGHT_ENABLE | 215 | #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) |
| 213 | if (record->event.pressed) { | 216 | if (record->event.pressed) { |
| 214 | userspace_config.rgb_layer_change ^= 1; | 217 | userspace_config.rgb_layer_change ^= 1; |
| 215 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); | 218 | xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); |
| @@ -237,24 +240,25 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { | |||
| 237 | 240 | ||
| 238 | 241 | ||
| 239 | 242 | ||
| 240 | void matrix_init_rgb(void) { | 243 | void matrix_init_rgb(void) { |
| 241 | 244 | ||
| 242 | if (userspace_config.rgb_layer_change) { | 245 | // #ifdef RGBLIGHT_ENABLE |
| 243 | rgblight_init(); | 246 | // if (userspace_config.rgb_layer_change) { |
| 244 | rgblight_enable_noeeprom(); | 247 | // rgblight_enable_noeeprom(); |
| 245 | switch (biton32(eeconfig_read_default_layer())) { | 248 | // switch (biton32(eeconfig_read_default_layer())) { |
| 246 | case _COLEMAK: | 249 | // case _COLEMAK: |
| 247 | rgblight_sethsv_noeeprom_magenta(); break; | 250 | // rgblight_sethsv_noeeprom_magenta(); break; |
| 248 | case _DVORAK: | 251 | // case _DVORAK: |
| 249 | rgblight_sethsv_noeeprom_springgreen(); break; | 252 | // rgblight_sethsv_noeeprom_springgreen(); break; |
| 250 | case _WORKMAN: | 253 | // case _WORKMAN: |
| 251 | rgblight_sethsv_noeeprom_goldenrod(); break; | 254 | // rgblight_sethsv_noeeprom_goldenrod(); break; |
| 252 | default: | 255 | // default: |
| 253 | rgblight_sethsv_noeeprom_cyan(); break; | 256 | // rgblight_sethsv_noeeprom_cyan(); break; |
| 254 | } | 257 | // } |
| 255 | rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); | 258 | // rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); |
| 256 | } | 259 | // } |
| 257 | } | 260 | // #endif |
| 261 | } | ||
| 258 | 262 | ||
| 259 | void matrix_scan_rgb(void) { | 263 | void matrix_scan_rgb(void) { |
| 260 | #ifdef RGBLIGHT_TWINKLE | 264 | #ifdef RGBLIGHT_TWINKLE |
| @@ -270,7 +274,6 @@ void matrix_scan_rgb(void) { | |||
| 270 | 274 | ||
| 271 | uint32_t layer_state_set_rgb(uint32_t state) { | 275 | uint32_t layer_state_set_rgb(uint32_t state) { |
| 272 | #ifdef RGBLIGHT_ENABLE | 276 | #ifdef RGBLIGHT_ENABLE |
| 273 | static bool has_ran; | ||
| 274 | if (userspace_config.rgb_layer_change) { | 277 | if (userspace_config.rgb_layer_change) { |
| 275 | switch (biton32(state)) { | 278 | switch (biton32(state)) { |
| 276 | case _MACROS: | 279 | case _MACROS: |
| @@ -312,12 +315,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { | |||
| 312 | default: | 315 | default: |
| 313 | rgblight_sethsv_noeeprom_cyan(); break; | 316 | rgblight_sethsv_noeeprom_cyan(); break; |
| 314 | } | 317 | } |
| 315 | if (has_ran) { | 318 | biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it |
| 316 | biton32(state) == _MODS ? rgblight_mode(RGBLIGHT_MODE_BREATHING) : rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it | ||
| 317 | } else { | ||
| 318 | biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it | ||
| 319 | has_ran = true; | ||
| 320 | } | ||
| 321 | break; | 319 | break; |
| 322 | } | 320 | } |
| 323 | // layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow | 321 | // layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow |
| @@ -326,3 +324,39 @@ uint32_t layer_state_set_rgb(uint32_t state) { | |||
| 326 | 324 | ||
| 327 | return state; | 325 | return state; |
| 328 | } | 326 | } |
| 327 | |||
| 328 | uint32_t default_layer_state_set_rgb(uint32_t state) { | ||
| 329 | #ifdef RGBLIGHT_ENABLE | ||
| 330 | if (userspace_config.rgb_layer_change) { | ||
| 331 | rgblight_config_t temp_rgblight_config = rgblight_config; | ||
| 332 | switch (biton32(state)) { | ||
| 333 | case _COLEMAK: | ||
| 334 | temp_rgblight_config.hue = 300; | ||
| 335 | temp_rgblight_config.val = 255; | ||
| 336 | temp_rgblight_config.sat = 255; | ||
| 337 | temp_rgblight_config.mode = 1; | ||
| 338 | break; | ||
| 339 | case _DVORAK: | ||
| 340 | temp_rgblight_config.hue = 150; | ||
| 341 | temp_rgblight_config.val = 255; | ||
| 342 | temp_rgblight_config.sat = 255; | ||
| 343 | temp_rgblight_config.mode = 1; | ||
| 344 | case _WORKMAN: | ||
| 345 | temp_rgblight_config.hue = 43; | ||
| 346 | temp_rgblight_config.val = 218; | ||
| 347 | temp_rgblight_config.sat = 218; | ||
| 348 | temp_rgblight_config.mode = 1; | ||
| 349 | default: | ||
| 350 | temp_rgblight_config.hue = 180; | ||
| 351 | temp_rgblight_config.val = 255; | ||
| 352 | temp_rgblight_config.sat = 255; | ||
| 353 | temp_rgblight_config.mode = 1; | ||
| 354 | } | ||
| 355 | if (temp_rgblight_config.raw != eeconfig_read_rgblight()) { | ||
| 356 | xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode); | ||
| 357 | eeconfig_update_rgblight(temp_rgblight_config.raw); | ||
| 358 | } | ||
| 359 | } | ||
| 360 | #endif // RGBLIGHT_ENABLE | ||
| 361 | return state; | ||
| 362 | } | ||
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 50c75c8c3..3db068a31 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h | |||
| @@ -12,4 +12,4 @@ void scan_rgblight_fadeout(void); | |||
| 12 | void matrix_init_rgb(void); | 12 | void matrix_init_rgb(void); |
| 13 | void matrix_scan_rgb(void); | 13 | void matrix_scan_rgb(void); |
| 14 | uint32_t layer_state_set_rgb(uint32_t state); | 14 | uint32_t layer_state_set_rgb(uint32_t state); |
| 15 | 15 | uint32_t default_layer_state_set_rgb(uint32_t state); | |
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 964c96c52..49b1ddae9 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk | |||
| @@ -27,6 +27,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | |||
| 27 | endif | 27 | endif |
| 28 | endif | 28 | endif |
| 29 | 29 | ||
| 30 | ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) | ||
| 31 | SRC += rgb_stuff.c | ||
| 32 | endif | ||
| 33 | |||
| 34 | |||
| 30 | ifeq ($(strip $(MACROS_ENABLED)), yes) | 35 | ifeq ($(strip $(MACROS_ENABLED)), yes) |
| 31 | OPT_DEFS += -DMACROS_ENABLED | 36 | OPT_DEFS += -DMACROS_ENABLED |
| 32 | endif | 37 | endif |
| @@ -37,3 +42,15 @@ ifdef CONSOLE_ENABLE | |||
| 37 | endif | 42 | endif |
| 38 | endif | 43 | endif |
| 39 | 44 | ||
| 45 | |||
| 46 | ifeq ($(strip $(UCIS_ENABLE)), yes) | ||
| 47 | SRC += send_unicode.c | ||
| 48 | endif | ||
| 49 | |||
| 50 | ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) | ||
| 51 | SRC += send_unicode.c | ||
| 52 | endif | ||
| 53 | |||
| 54 | ifeq ($(strip $(UNICODE_ENABLE)), yes) | ||
| 55 | SRC += send_unicode.c | ||
| 56 | endif | ||
diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c index cacfe1dc8..ff35368da 100644 --- a/users/drashna/send_unicode.c +++ b/users/drashna/send_unicode.c | |||
| @@ -56,3 +56,57 @@ void send_unicode_hex_string(const char* str) { | |||
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | // If you need a good converter: https://r12a.github.io/app-conversion/ | 58 | // If you need a good converter: https://r12a.github.io/app-conversion/ |
| 59 | uint8_t saved_mods; | ||
| 60 | |||
| 61 | void unicode_input_start (void) { | ||
| 62 | // save current mods | ||
| 63 | saved_mods = get_mods(); // Save current mods | ||
| 64 | clear_mods(); // Unregister mods to start from a clean state | ||
| 65 | |||
| 66 | switch(get_unicode_input_mode()) { | ||
| 67 | case UC_OSX: | ||
| 68 | register_code(KC_LALT); | ||
| 69 | break; | ||
| 70 | case UC_OSX_RALT: | ||
| 71 | register_code(KC_RALT); | ||
| 72 | break; | ||
| 73 | case UC_LNX: | ||
| 74 | register_code(KC_LCTL); | ||
| 75 | register_code(KC_LSFT); | ||
| 76 | register_code(KC_U); | ||
| 77 | unregister_code(KC_U); | ||
| 78 | unregister_code(KC_LSFT); | ||
| 79 | unregister_code(KC_LCTL); | ||
| 80 | break; | ||
| 81 | case UC_WIN: | ||
| 82 | register_code(KC_LALT); | ||
| 83 | register_code(KC_PPLS); | ||
| 84 | unregister_code(KC_PPLS); | ||
| 85 | break; | ||
| 86 | case UC_WINC: | ||
| 87 | register_code(KC_RALT); | ||
| 88 | unregister_code(KC_RALT); | ||
| 89 | register_code(KC_U); | ||
| 90 | unregister_code(KC_U); | ||
| 91 | break; | ||
| 92 | } | ||
| 93 | wait_ms(UNICODE_TYPE_DELAY); | ||
| 94 | } | ||
| 95 | |||
| 96 | void unicode_input_finish (void) { | ||
| 97 | switch(get_unicode_input_mode()) { | ||
| 98 | case UC_OSX: | ||
| 99 | case UC_WIN: | ||
| 100 | unregister_code(KC_LALT); | ||
| 101 | break; | ||
| 102 | case UC_OSX_RALT: | ||
| 103 | unregister_code(KC_RALT); | ||
| 104 | break; | ||
| 105 | case UC_LNX: | ||
| 106 | register_code(KC_SPC); | ||
| 107 | unregister_code(KC_SPC); | ||
| 108 | break; | ||
| 109 | } | ||
| 110 | |||
| 111 | set_mods(saved_mods); // Reregister previously set mods | ||
| 112 | } | ||
diff --git a/users/drashna/template.c b/users/drashna/template.c index e6b50c961..0e188f3a5 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c | |||
| @@ -50,12 +50,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 50 | return false; | 50 | return false; |
| 51 | break; | 51 | break; |
| 52 | 52 | ||
| 53 | case EPRM: | ||
| 54 | if (record->event.pressed) { | ||
| 55 | eeconfig_init(); | ||
| 56 | } | ||
| 57 | return false; | ||
| 58 | break; | ||
| 59 | case VRSN: | 53 | case VRSN: |
| 60 | if (record->event.pressed) { | 54 | if (record->event.pressed) { |
| 61 | SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); | 55 | SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); |
| @@ -128,4 +122,3 @@ void shutdown_keymap(void) {} | |||
| 128 | void shutdown_user (void) { | 122 | void shutdown_user (void) { |
| 129 | shutdown_keymap(); | 123 | shutdown_keymap(); |
| 130 | } | 124 | } |
| 131 | |||
diff --git a/users/drashna/template.h b/users/drashna/template.h index 5b3a93de5..dd1c48760 100644 --- a/users/drashna/template.h +++ b/users/drashna/template.h | |||
| @@ -9,9 +9,7 @@ | |||
| 9 | #define BASE 0 | 9 | #define BASE 0 |
| 10 | 10 | ||
| 11 | enum custom_keycodes { | 11 | enum custom_keycodes { |
| 12 | PLACEHOLDER = SAFE_RANGE, // can always be here | 12 | VRSN = SAFE_RANGE, // can always be here |
| 13 | EPRM, | ||
| 14 | VRSN, | ||
| 15 | KC_MAKE, | 13 | KC_MAKE, |
| 16 | KC_RESET, | 14 | KC_RESET, |
| 17 | NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes | 15 | NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes |
