Change keymap encoder code

Co-Authored-By: Joel Challis <git@zvecr.com>
This commit is contained in:
Maarten Dekkers 2020-04-24 19:41:05 +02:00 committed by GitHub
parent 1df8bb3cdb
commit 5c9c45619e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,23 +19,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
switch(get_highest_layer(layer_state)){
case 0: //Layer 0
if (!clockwise) { // Remove ! to reverse direction
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
break;
case 1: //Layer 1
if (!clockwise) {
if (!clockwise) { // Remove ! to reverse direction
tap_code(KC_WH_U);
} else {
tap_code(KC_WH_D);
}
break;
default:
default: //Layer 0
if (!clockwise) {
tap_code(KC_VOLU);
} else {
@ -43,5 +35,4 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
}
}