forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate keycode handling for LED Matrix and Backlight (qmk#23426)
- Loading branch information
1 parent
d854eef
commit be101b0
Showing
5 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright 2024 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include "action.h" | ||
|
||
bool process_led_matrix(uint16_t keycode, keyrecord_t *record); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters