Skip to content

Commit

Permalink
Change keymap encoder code
Browse files Browse the repository at this point in the history
Co-Authored-By: Joel Challis <[email protected]>
  • Loading branch information
2 people authored and turky committed Jun 13, 2020
1 parent 9fae763 commit 1c227b5
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions keyboards/maartenwut/ta65/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,20 @@ 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) {
tap_code(KC_WH_U);
} else {
tap_code(KC_WH_D);
}
break;
default:
if (!clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
break;
}
switch(get_highest_layer(layer_state)){
case 1: //Layer 1
if (!clockwise) { // Remove ! to reverse direction
tap_code(KC_WH_U);
} else {
tap_code(KC_WH_D);
}
break;
default: //Layer 0
if (!clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
break;
}
}

0 comments on commit 1c227b5

Please sign in to comment.