logo

qmk_firmware

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

cxt_studio.c (989B)


  1. // Copyright 2023 Colin Kinloch (@ColinKinloch)
  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. switch (index) {
  10. case 0: {
  11. if (clockwise) {
  12. tap_code_delay(KC_VOLU, 10);
  13. } else {
  14. tap_code_delay(KC_VOLD, 10);
  15. }
  16. }
  17. break;
  18. case 1: {
  19. if (clockwise) {
  20. rgb_matrix_increase_hue();
  21. } else {
  22. rgb_matrix_decrease_hue();
  23. }
  24. }
  25. break;
  26. case 2: {
  27. if (clockwise) {
  28. rgb_matrix_increase_val();
  29. } else {
  30. rgb_matrix_decrease_val();
  31. }
  32. }
  33. break;
  34. case 3: {
  35. if (clockwise) {
  36. rgb_matrix_step();
  37. } else {
  38. rgb_matrix_step_reverse();
  39. }
  40. }
  41. break;
  42. }
  43. return true;
  44. }
  45. #endif