rev2.c 691 B

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