rev4.c 571 B

123456789101112131415161718192021222324
  1. // Copyright 2025 Danny Nguyen (danny@keeb.io)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. #ifdef ENCODER_ENABLE
  5. bool encoder_update_kb(uint8_t index, bool clockwise) {
  6. if (!encoder_update_user(index, clockwise)) { return false; }
  7. if (index == 0) {
  8. if (clockwise) {
  9. tap_code(KC_VOLU);
  10. } else {
  11. tap_code(KC_VOLD);
  12. }
  13. } else if (index == 1) {
  14. if (clockwise) {
  15. tap_code(KC_PGDN);
  16. } else {
  17. tap_code(KC_PGUP);
  18. }
  19. }
  20. return false;
  21. }
  22. #endif