diff options
author | Nick Brassel <nick@tzarc.org> | 2022-11-06 08:11:59 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 08:11:59 +1100 |
commit | 219afaba42e6b4384f578977eadbb71a03383ecc (patch) | |
tree | 78f7c30b94d9ade9fb84821ed3a3ce463a3afa19 /quantum | |
parent | 352beeac2f62edf1f3288a2a7aa0f1e3bafa7dfd (diff) |
Reworked backlight keycodes. (#18961)
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/keycodes.h | 23 | ||||
-rw-r--r-- | quantum/process_keycode/process_backlight.c | 26 | ||||
-rw-r--r-- | quantum/quantum_keycodes_legacy.h | 3 |
3 files changed, 31 insertions, 21 deletions
diff --git a/quantum/keycodes.h b/quantum/keycodes.h index ec07648ab5..db4d373234 100644 --- a/quantum/keycodes.h +++ b/quantum/keycodes.h @@ -614,13 +614,13 @@ enum qk_keycode_defines { QK_MACRO_29 = 0x771D, QK_MACRO_30 = 0x771E, QK_MACRO_31 = 0x771F, - BL_ON = 0x7800, - BL_OFF = 0x7801, - BL_DEC = 0x7802, - BL_INC = 0x7803, - BL_TOGG = 0x7804, - BL_STEP = 0x7805, - BL_BRTG = 0x7806, + QK_BACKLIGHT_ON = 0x7800, + QK_BACKLIGHT_OFF = 0x7801, + QK_BACKLIGHT_TOGGLE = 0x7802, + QK_BACKLIGHT_DOWN = 0x7803, + QK_BACKLIGHT_UP = 0x7804, + QK_BACKLIGHT_STEP = 0x7805, + QK_BACKLIGHT_TOGGLE_BREATHING = 0x7806, RGB_TOG = 0x7820, RGB_MODE_FORWARD = 0x7821, RGB_MODE_REVERSE = 0x7822, @@ -1039,6 +1039,13 @@ enum qk_keycode_defines { MC_29 = QK_MACRO_29, MC_30 = QK_MACRO_30, MC_31 = QK_MACRO_31, + BL_ON = QK_BACKLIGHT_ON, + BL_OFF = QK_BACKLIGHT_OFF, + BL_TOGG = QK_BACKLIGHT_TOGGLE, + BL_DOWN = QK_BACKLIGHT_DOWN, + BL_UP = QK_BACKLIGHT_UP, + BL_STEP = QK_BACKLIGHT_STEP, + BL_BRTG = QK_BACKLIGHT_TOGGLE_BREATHING, RGB_MOD = RGB_MODE_FORWARD, RGB_RMOD = RGB_MODE_REVERSE, RGB_M_P = RGB_MODE_PLAIN, @@ -1151,7 +1158,7 @@ enum qk_keycode_defines { #define IS_AUDIO_KEYCODE(code) ((code) >= QK_AUDIO_ON && (code) <= QK_AUDIO_VOICE_PREVIOUS) #define IS_STENO_KEYCODE(code) ((code) >= QK_STENO_BOLT && (code) <= QK_STENO_COMB_MAX) #define IS_MACRO_KEYCODE(code) ((code) >= QK_MACRO_0 && (code) <= QK_MACRO_31) -#define IS_BACKLIGHT_KEYCODE(code) ((code) >= BL_ON && (code) <= BL_BRTG) +#define IS_BACKLIGHT_KEYCODE(code) ((code) >= QK_BACKLIGHT_ON && (code) <= QK_BACKLIGHT_TOGGLE_BREATHING) #define IS_RGB_KEYCODE(code) ((code) >= RGB_TOG && (code) <= RGB_MODE_TWINKLE) #define IS_QUANTUM_KEYCODE(code) ((code) >= QK_BOOTLOADER && (code) <= QK_AUTOCORRECT_TOGGLE) diff --git a/quantum/process_keycode/process_backlight.c b/quantum/process_keycode/process_backlight.c index 8b70339a55..c1596ec07d 100644 --- a/quantum/process_keycode/process_backlight.c +++ b/quantum/process_keycode/process_backlight.c @@ -26,45 +26,45 @@ bool process_backlight(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { #ifdef LED_MATRIX_ENABLE - case BL_ON: + case QK_BACKLIGHT_ON: led_matrix_enable(); return false; - case BL_OFF: + case QK_BACKLIGHT_OFF: led_matrix_disable(); return false; - case BL_DEC: + case QK_BACKLIGHT_DOWN: led_matrix_decrease_val(); return false; - case BL_INC: + case QK_BACKLIGHT_UP: led_matrix_increase_val(); return false; - case BL_TOGG: + case QK_BACKLIGHT_TOGGLE: led_matrix_toggle(); return false; - case BL_STEP: + case QK_BACKLIGHT_STEP: led_matrix_step(); return false; #else - case BL_ON: + case QK_BACKLIGHT_ON: backlight_level(BACKLIGHT_LEVELS); return false; - case BL_OFF: + case QK_BACKLIGHT_OFF: backlight_level(0); return false; - case BL_DEC: + case QK_BACKLIGHT_DOWN: backlight_decrease(); return false; - case BL_INC: + case QK_BACKLIGHT_UP: backlight_increase(); return false; - case BL_TOGG: + case QK_BACKLIGHT_TOGGLE: backlight_toggle(); return false; - case BL_STEP: + case QK_BACKLIGHT_STEP: backlight_step(); return false; # ifdef BACKLIGHT_BREATHING - case BL_BRTG: + case QK_BACKLIGHT_TOGGLE_BREATHING: backlight_toggle_breathing(); return false; # endif diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h index 44044ec625..e2133513bd 100644 --- a/quantum/quantum_keycodes_legacy.h +++ b/quantum/quantum_keycodes_legacy.h @@ -123,6 +123,9 @@ #define KC_RAPC QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE #define KC_SFTENT QK_SPACE_CADET_RIGHT_SHIFT_ENTER +#define BL_DEC QK_BACKLIGHT_DOWN +#define BL_INC QK_BACKLIGHT_UP + #define AU_TOG QK_AUDIO_TOGGLE #define CLICKY_TOGGLE QK_AUDIO_CLICKY_TOGGLE #define CLICKY_ENABLE QK_AUDIO_CLICKY_ON |