2022-01-09 12:53:45 +09:00
|
|
|
// Copyright 2021 @wekey (@@wekey)
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2023-04-15 21:08:15 +10:00
|
|
|
#include "quantum.h"
|
2022-01-09 12:53:45 +09:00
|
|
|
|
2023-05-09 21:30:35 -07:00
|
|
|
#if defined(ENCODER_ENABLE)
|
2022-01-09 12:53:45 +09:00
|
|
|
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
|
|
|
if (!encoder_update_user(index, clockwise)) { return false; }
|
2023-05-09 21:30:35 -07:00
|
|
|
if (index == 0) {
|
|
|
|
if (clockwise) {
|
|
|
|
tap_code_delay(KC_VOLU, 10);
|
|
|
|
} else {
|
|
|
|
tap_code_delay(KC_VOLD, 10);
|
|
|
|
}
|
|
|
|
}
|
2022-01-09 12:53:45 +09:00
|
|
|
return true;
|
2023-05-09 21:30:35 -07:00
|
|
|
}
|
|
|
|
#endif
|