logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rev8.c (857B)


  1. // Copyright 2023 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. } else if (index == 2) {
  20. if (clockwise) {
  21. tap_code(KC_VOLU);
  22. } else {
  23. tap_code(KC_VOLD);
  24. }
  25. } else if (index == 3) {
  26. if (clockwise) {
  27. tap_code(KC_PGDN);
  28. } else {
  29. tap_code(KC_PGUP);
  30. }
  31. }
  32. return false;
  33. }
  34. #endif