add encoder and dip

This commit is contained in:
Jack Humbert 2018-09-20 01:11:53 -04:00
parent cd4a01d296
commit d24132ce71
4 changed files with 93 additions and 12 deletions

View file

@ -259,7 +259,7 @@ uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;
void encoder_update(bool clockwise) {
void encoder_update(uint8_t index, bool clockwise) {
if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
@ -275,12 +275,22 @@ void encoder_update(bool clockwise) {
}
}
} else {
if (clockwise) {
register_code(KC_PGDN);
unregister_code(KC_PGDN);
if (index == 0) {
if (clockwise) {
register_code(KC_PGDN);
unregister_code(KC_PGDN);
} else {
register_code(KC_PGUP);
unregister_code(KC_PGUP);
}
} else {
register_code(KC_PGUP);
unregister_code(KC_PGUP);
if (clockwise) {
register_code(KC_MS_WH_DOWN);
unregister_code(KC_MS_WH_DOWN);
} else {
register_code(KC_MS_WH_UP);
unregister_code(KC_MS_WH_UP);
}
}
}
}