You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

  1. /* Copyright 2019
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "process_backlight.h"
  17. #include "backlight.h"
  18. bool process_backlight(uint16_t keycode, keyrecord_t *record) {
  19. if (record->event.pressed) {
  20. switch (keycode) {
  21. case BL_ON:
  22. backlight_level(BACKLIGHT_LEVELS);
  23. return false;
  24. case BL_OFF:
  25. backlight_level(0);
  26. return false;
  27. case BL_DEC:
  28. backlight_decrease();
  29. return false;
  30. case BL_INC:
  31. backlight_increase();
  32. return false;
  33. case BL_TOGG:
  34. backlight_toggle();
  35. return false;
  36. case BL_STEP:
  37. backlight_step();
  38. return false;
  39. #ifdef BACKLIGHT_BREATHING
  40. case BL_BRTG:
  41. backlight_toggle_breathing();
  42. return false;
  43. #endif
  44. }
  45. }
  46. return true;
  47. }