aboutsummaryrefslogtreecommitdiff
path: root/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c')
-rw-r--r--keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c
index eabd8d23a..0bdc15214 100644
--- a/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c
+++ b/keyboards/massdrop/ctrl/keymaps/responsive_pattern/keymap.c
@@ -37,7 +37,7 @@ enum ctrl_keycodes {
37 DBG_KBD, //DEBUG Toggle Keyboard Prints 37 DBG_KBD, //DEBUG Toggle Keyboard Prints
38 DBG_MOU, //DEBUG Toggle Mouse Prints 38 DBG_MOU, //DEBUG Toggle Mouse Prints
39 MD_BOOT, //Restart into bootloader after hold timeout 39 MD_BOOT, //Restart into bootloader after hold timeout
40 40
41 L_SP_PR, //LED Splash Pattern Select Previous 41 L_SP_PR, //LED Splash Pattern Select Previous
42 L_SP_NE, //LED Splash Pattern Select Next 42 L_SP_NE, //LED Splash Pattern Select Next
43 43
@@ -178,7 +178,7 @@ static void init_distance_map(void){
178 uint8_t id2 = ktli(KEY_POSITION_MAP[j][i]); 178 uint8_t id2 = ktli(KEY_POSITION_MAP[j][i]);
179 179
180 if(id1 == id2) continue; 180 if(id1 == id2) continue;
181 181
182 uint8_t dx = abs(i - x); 182 uint8_t dx = abs(i - x);
183 uint8_t dy = abs(j - y); 183 uint8_t dy = abs(j - y);
184 uint8_t dis = dx + dy; 184 uint8_t dis = dx + dy;
@@ -277,15 +277,15 @@ void led_matrix_run(void)
277 bo = 0; 277 bo = 0;
278 278
279 uint8_t led_index = led_cur - led_map; // only this part differs from the original function. 279 uint8_t led_index = led_cur - led_map; // only this part differs from the original function.
280 if(led_index < KEY_LED_COUNT){ // 280 if(led_index < KEY_LED_COUNT){ //
281 user_led_cur = USER_LED[led_index]; // `struct user_led_t USER_LED[]` is stored globally. 281 user_led_cur = USER_LED[led_index]; // `struct user_led_t USER_LED[]` is stored globally.
282 } // 282 } //
283 // 283 //
284 if(led_index < KEY_LED_COUNT && user_led_cur.state){ // `user_led_cur` is just for convenience 284 if(led_index < KEY_LED_COUNT && user_led_cur.state){ // `user_led_cur` is just for convenience
285 ro = user_led_cur.r; // 285 ro = user_led_cur.r; //
286 go = user_led_cur.g; // 286 go = user_led_cur.g; //
287 bo = user_led_cur.b; // 287 bo = user_led_cur.b; //
288 } // 288 } //
289 else if (led_lighting_mode == LED_MODE_KEYS_ONLY && led_cur->scan == 255) 289 else if (led_lighting_mode == LED_MODE_KEYS_ONLY && led_cur->scan == 255)
290 { 290 {
291 //Do not act on this LED 291 //Do not act on this LED
@@ -513,7 +513,7 @@ static uint8_t COLOR_PATTERNS[][COLOR_PATTERN_RGB_COUNT][3] = {
513 {181, 181, 181}, {164, 164, 164}, {147, 147, 147}, 513 {181, 181, 181}, {164, 164, 164}, {147, 147, 147},
514 {128, 128, 128}, {108, 108, 108}, { 88, 88, 88}, 514 {128, 128, 128}, {108, 108, 108}, { 88, 88, 88},
515 { 66, 66, 66}, { 45, 45, 45}, { 23, 23, 23}, 515 { 66, 66, 66}, { 45, 45, 45}, { 23, 23, 23},
516 }, 516 },
517}; 517};
518static const uint8_t COLOR_PATTERNS_COUNT = ( 518static const uint8_t COLOR_PATTERNS_COUNT = (
519 sizeof(COLOR_PATTERNS) / sizeof(COLOR_PATTERNS[0])); 519 sizeof(COLOR_PATTERNS) / sizeof(COLOR_PATTERNS[0]));
@@ -561,7 +561,7 @@ void refresh_color_pattern_indicators(void){
561 static uint8_t ZXCVBNM_COMM_DOT[] = { 561 static uint8_t ZXCVBNM_COMM_DOT[] = {
562 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, 562 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,
563 }; 563 };
564 564
565 if(layer_state >= 0x04){ 565 if(layer_state >= 0x04){
566 uint8_t (*c)[3] = &COLOR_PATTERNS[USER_CONFIG.COLOR_PATTERN_INDEX][0]; 566 uint8_t (*c)[3] = &COLOR_PATTERNS[USER_CONFIG.COLOR_PATTERN_INDEX][0];
567 for(uint8_t i = 0; i < 9; ++i){ 567 for(uint8_t i = 0; i < 9; ++i){
@@ -589,7 +589,7 @@ void matrix_scan_user(void) {
589 589
590 calculate_keystroke_distance(); 590 calculate_keystroke_distance();
591 591
592 592
593 #define USE_PATTERN 0 593 #define USE_PATTERN 0
594 #define BLACK_RGB 1 594 #define BLACK_RGB 1
595 #define COLOR_RGB 2 595 #define COLOR_RGB 2
@@ -599,7 +599,7 @@ void matrix_scan_user(void) {
599 uint8_t distance; 599 uint8_t distance;
600 for(uint8_t i = 1; i <= KEY_LED_COUNT; ++i){ 600 for(uint8_t i = 1; i <= KEY_LED_COUNT; ++i){
601 if(USER_LED[i-1].state >= 2) continue; 601 if(USER_LED[i-1].state >= 2) continue;
602 602
603 handle_type = USE_PATTERN; 603 handle_type = USE_PATTERN;
604 distance = DISTANCE_FROM_LAST_KEYSTROKE[i]; 604 distance = DISTANCE_FROM_LAST_KEYSTROKE[i];
605 605
@@ -695,9 +695,9 @@ void matrix_scan_user(void) {
695 695
696}; 696};
697 697
698#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) 698#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
699#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) 699#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
700#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) 700#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
701 701
702bool process_record_user(uint16_t keycode, keyrecord_t *record) { 702bool process_record_user(uint16_t keycode, keyrecord_t *record) {
703 static uint32_t key_timer; 703 static uint32_t key_timer;
@@ -835,7 +835,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
835 835
836 836
837 837
838 838
839 case L_SP_PR: // previous dripple pattern 839 case L_SP_PR: // previous dripple pattern
840 case L_SP_NE: // next dripple pattern 840 case L_SP_NE: // next dripple pattern
841 if (record->event.pressed) { 841 if (record->event.pressed) {
@@ -880,7 +880,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
880 USER_CONFIG.WAVE_PERIOD = 10; 880 USER_CONFIG.WAVE_PERIOD = 10;
881 break; 881 break;
882 } 882 }
883 883
884 // remove effect after changing pattern 884 // remove effect after changing pattern
885 for(int i = 0; i < KEY_STROKES_LENGTH; ++i){ 885 for(int i = 0; i < KEY_STROKES_LENGTH; ++i){
886 KEY_STROKES[i].alive = 0; 886 KEY_STROKES[i].alive = 0;
@@ -903,7 +903,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
903 case L_SP_SL: 903 case L_SP_SL:
904 if(record->event.pressed){ 904 if(record->event.pressed){
905 short incre = keycode == L_SP_FA ? -1 : 1; 905 short incre = keycode == L_SP_FA ? -1 : 1;
906 906
907 USER_CONFIG.WAVE_PERIOD += 10 * incre; 907 USER_CONFIG.WAVE_PERIOD += 10 * incre;
908 if(USER_CONFIG.WAVE_PERIOD < 10){ 908 if(USER_CONFIG.WAVE_PERIOD < 10){
909 USER_CONFIG.WAVE_PERIOD = 10; 909 USER_CONFIG.WAVE_PERIOD = 10;