1
0
Fork 0

[Keyboard] fix encoder void to bool (#13334)

This commit is contained in:
Xelus22 2021-06-29 13:30:39 +10:00 committed by GitHub
parent 2b2e8bfdb7
commit de8939aa5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View file

@ -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) { if (clockwise) {
tap_code(KC_VOLU); tap_code(KC_VOLU);
} else { } else {
tap_code(KC_VOLD); tap_code(KC_VOLD);
} }
return true;
} }

View file

@ -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) { if (clockwise) {
tap_code(KC_VOLU); tap_code(KC_VOLU);
} else { } else {
tap_code(KC_VOLD); tap_code(KC_VOLD);
} }
return true;
} }

View file

@ -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) { if (clockwise) {
tap_code(KC_VOLU); tap_code(KC_VOLU);
} else { } else {
tap_code(KC_VOLD); tap_code(KC_VOLD);
} }
return true;
} }

View file

@ -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) { if (clockwise) {
encoder_cw.pressed = true; encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1); encoder_cw.time = (timer_read() | 1);
@ -61,4 +61,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
encoder_ccw.time = (timer_read() | 1); encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw); action_exec(encoder_ccw);
} }
return true;
} }