logo

qmk_firmware

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

rev4.c (643B)


  1. // Copyright 2024 splitkb.com (support@splitkb.com)
  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)) {
  7. return false;
  8. }
  9. if (index == 0) {
  10. // Volume control
  11. if (clockwise) {
  12. tap_code(KC_VOLU);
  13. } else {
  14. tap_code(KC_VOLD);
  15. }
  16. } else if (index == 1) {
  17. // Page up/Page down
  18. if (clockwise) {
  19. tap_code(KC_PGDN);
  20. } else {
  21. tap_code(KC_PGUP);
  22. }
  23. }
  24. return false;
  25. }
  26. #endif