Skip to content

Commit

Permalink
moved encoder code to timberwolf.c (qmk#10317)
Browse files Browse the repository at this point in the history
* moved encoder code to timberwolf.c

* Update keyboards/metamechs/timberwolf/timberwolf.c

Co-authored-by: Drashna Jaelre <[email protected]>

Co-authored-by: Drashna Jaelre <[email protected]>
  • Loading branch information
Croktopus and drashna authored Sep 22, 2020
1 parent db73c4d commit 8539dce
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 72 deletions.
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/a_ansi/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______, _______,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/a_iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______, _______,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/b_ansi/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______ ,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/b_iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______ ,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/prime_ansi/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______ ,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/prime_iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
MO(1) ,_______,_______,_______ ,_______ ,_______,_______,_______ ,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
10 changes: 1 addition & 9 deletions keyboards/metamechs/timberwolf/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,_______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
};
9 changes: 9 additions & 0 deletions keyboards/metamechs/timberwolf/timberwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ bool led_update_kb(led_t led_state) {
}
return runDefault;
}

__attribute__((weak))
void encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}

0 comments on commit 8539dce

Please sign in to comment.