Change aidansmithdotdev/fine40 to use Encoder Map (#19912)
Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: jack <0x6a73@protonmail.com>
This commit is contained in:
		@@ -71,15 +71,15 @@ bool oled_task_kb(void) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#ifdef ENCODER_ENABLE
 | 
					#ifdef ENCODER_ENABLE
 | 
				
			||||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
 | 
					bool encoder_update_kb(uint8_t index, bool clockwise) {
 | 
				
			||||||
    if (!encoder_update_user(index, clockwise)) {
 | 
					   if (!encoder_update_user(index, clockwise)) {
 | 
				
			||||||
        return false;
 | 
					       return false;
 | 
				
			||||||
    }
 | 
					   }
 | 
				
			||||||
	// Volume control
 | 
					   // Volume control
 | 
				
			||||||
	if (clockwise) {
 | 
					   if (clockwise) {
 | 
				
			||||||
		tap_code(KC_VOLU);
 | 
					   	tap_code(KC_VOLU);
 | 
				
			||||||
	} else {
 | 
					   } else {
 | 
				
			||||||
		tap_code(KC_VOLD);
 | 
					   	tap_code(KC_VOLD);
 | 
				
			||||||
	}
 | 
					   }
 | 
				
			||||||
	return false;
 | 
					   return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@@ -27,7 +27,7 @@
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
    "encoder": {
 | 
					    "encoder": {
 | 
				
			||||||
        "rotary": [
 | 
					        "rotary": [
 | 
				
			||||||
            {"pin_a": "D5", "pin_b": "B7", "resolution": 2}
 | 
					            {"pin_a": "B7", "pin_b": "D5", "resolution": 2}
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "layouts": {
 | 
					    "layouts": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,3 +41,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
				
			|||||||
  _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______
 | 
					  _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______
 | 
				
			||||||
),
 | 
					),
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(ENCODER_MAP_ENABLE)
 | 
				
			||||||
 | 
					const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
 | 
				
			||||||
 | 
					    [_MAIN] =  { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_LEFT] =  { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_RIGHT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_TAB] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					ENCODER_MAP_ENABLE = yes
 | 
				
			||||||
@@ -41,3 +41,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
				
			|||||||
  _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______
 | 
					  _______ , _______ , _______ , _______ , _______ , _______ , _______ , KC_MS_L , KC_MS_D , KC_MS_U , KC_MS_R , _______
 | 
				
			||||||
),
 | 
					),
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(ENCODER_MAP_ENABLE)
 | 
				
			||||||
 | 
					const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
 | 
				
			||||||
 | 
					    [_MAIN] =  { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_LEFT] =  { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_RIGHT] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					    [_TAB] =   { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -1 +1,2 @@
 | 
				
			|||||||
VIA_ENABLE = yes
 | 
					VIA_ENABLE = yes
 | 
				
			||||||
 | 
					ENCODER_MAP_ENABLE = yes
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user