2 Copyright (C) 2019 Maxr1998 <max.rumpf1998@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 const uint16_t PROGMEM led_adjust_combo
[] = {KC_LEFT
, KC_RGHT
, COMBO_END
};
27 combo_t key_combos
[COMBO_COUNT
] = {
28 [LED_ADJUST
] = COMBO_ACTION(led_adjust_combo
)
31 bool led_adjust_active
= false;
33 void matrix_init_kb(void) {
37 void process_combo_event(uint8_t combo_index
, bool pressed
) {
38 if (combo_index
== LED_ADJUST
) {
39 led_adjust_active
= pressed
;
43 void encoder_update_kb(uint8_t index
, bool clockwise
) {
45 if (led_adjust_active
) {
47 rgblight_increase_val();
49 rgblight_decrease_val();
51 } else encoder_one_update(clockwise
);
52 } else if (index
== 1) {
53 if (led_adjust_active
) {
55 rgblight_increase_hue();
57 rgblight_decrease_hue();
59 } else encoder_two_update(clockwise
);