logo

qmk_firmware

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

bento_box.c (810B)


  1. // Copyright 2023 Synth-and-Keys (@Synth-and-Keys)
  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. /*Main Encoder*/
  10. if (index == 0) {
  11. if (clockwise) {
  12. tap_code(KC_VOLU);
  13. } else {
  14. tap_code(KC_VOLD);
  15. }
  16. }
  17. /* TOP LEFT*/
  18. else if (index == 1) {
  19. if (clockwise) {
  20. tap_code16(C(KC_EQUAL));
  21. } else {
  22. tap_code16(C(KC_MINUS));
  23. }
  24. }
  25. /* TOP RIGHT*/
  26. else if (index == 2) {
  27. if (clockwise) {
  28. tap_code16(C(KC_Y));
  29. } else {
  30. tap_code16(C(KC_Z));
  31. }
  32. }
  33. return true;
  34. }
  35. #endif