process_led_matrix.c 912 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2024 QMK
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "process_led_matrix.h"
  4. #include "led_matrix.h"
  5. bool process_led_matrix(uint16_t keycode, keyrecord_t *record) {
  6. if (record->event.pressed) {
  7. switch (keycode) {
  8. case QK_BACKLIGHT_ON:
  9. led_matrix_enable();
  10. return false;
  11. case QK_BACKLIGHT_OFF:
  12. led_matrix_disable();
  13. return false;
  14. case QK_BACKLIGHT_DOWN:
  15. led_matrix_decrease_val();
  16. return false;
  17. case QK_BACKLIGHT_UP:
  18. led_matrix_increase_val();
  19. return false;
  20. case QK_BACKLIGHT_TOGGLE:
  21. led_matrix_toggle();
  22. return false;
  23. case QK_BACKLIGHT_STEP:
  24. led_matrix_step();
  25. return false;
  26. }
  27. }
  28. return true;
  29. }