Skip to content

Commit

Permalink
[Keyboard] fix encoder void to bool (qmk#13334)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xelus22 authored and jakeprime committed Jul 10, 2021
1 parent 3a2c774 commit 278d77a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion keyboards/ramonimbao/squishytkl/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}
3 changes: 2 additions & 1 deletion keyboards/ramonimbao/squishytkl/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}
3 changes: 2 additions & 1 deletion keyboards/ramonimbao/squishytkl/keymaps/jis/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}
3 changes: 2 additions & 1 deletion keyboards/ramonimbao/squishytkl/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void matrix_scan_user(void) {
}
}

void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
Expand All @@ -61,4 +61,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
return true;
}

0 comments on commit 278d77a

Please sign in to comment.