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

@ -0,0 +1,32 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "process_led_matrix.h"
#include "led_matrix.h"
bool process_led_matrix(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
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;
}
}
return true;
}