1
0
Fork 0

Separate keycode handling for LED Matrix and Backlight (#23426)

This commit is contained in:
Ryan 2024-04-11 14:06:36 +10:00 committed by GitHub
parent 4acdddbf48
commit 25f608c1b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 31 deletions

View file

@ -15,36 +15,11 @@
*/
#include "process_backlight.h"
#ifdef LED_MATRIX_ENABLE
# include "led_matrix.h"
#else
# include "backlight.h"
#endif
#include "backlight.h"
bool process_backlight(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
#ifdef LED_MATRIX_ENABLE
case QK_BACKLIGHT_ON:
led_matrix_enable();
return false;
case QK_BACKLIGHT_OFF:
led_matrix_disable();
return false;
case QK_BACKLIGHT_DOWN:
led_matrix_decrease_val();
return false;
case QK_BACKLIGHT_UP:
led_matrix_increase_val();
return false;
case QK_BACKLIGHT_TOGGLE:
led_matrix_toggle();
return false;
case QK_BACKLIGHT_STEP:
led_matrix_step();
return false;
#else
case QK_BACKLIGHT_ON:
backlight_level(BACKLIGHT_LEVELS);
return false;
@ -63,11 +38,10 @@ bool process_backlight(uint16_t keycode, keyrecord_t *record) {
case QK_BACKLIGHT_STEP:
backlight_step();
return false;
# ifdef BACKLIGHT_BREATHING
#ifdef BACKLIGHT_BREATHING
case QK_BACKLIGHT_TOGGLE_BREATHING:
backlight_toggle_breathing();
return false;
# endif
#endif
}
}