Change keymap encoder code
Co-Authored-By: Joel Challis <git@zvecr.com>
This commit is contained in:
parent
1df8bb3cdb
commit
5c9c45619e
1 changed files with 15 additions and 24 deletions
|
@ -19,29 +19,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
if (index == 0) { /* First encoder */
|
switch(get_highest_layer(layer_state)){
|
||||||
switch(get_highest_layer(layer_state)){
|
case 1: //Layer 1
|
||||||
case 0: //Layer 0
|
if (!clockwise) { // Remove ! to reverse direction
|
||||||
if (!clockwise) { // Remove ! to reverse direction
|
tap_code(KC_WH_U);
|
||||||
tap_code(KC_VOLU);
|
} else {
|
||||||
} else {
|
tap_code(KC_WH_D);
|
||||||
tap_code(KC_VOLD);
|
}
|
||||||
}
|
break;
|
||||||
break;
|
default: //Layer 0
|
||||||
case 1: //Layer 1
|
if (!clockwise) {
|
||||||
if (!clockwise) {
|
tap_code(KC_VOLU);
|
||||||
tap_code(KC_WH_U);
|
} else {
|
||||||
} else {
|
tap_code(KC_VOLD);
|
||||||
tap_code(KC_WH_D);
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (!clockwise) {
|
|
||||||
tap_code(KC_VOLU);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_VOLD);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue