aboutsummaryrefslogtreecommitdiff
path: root/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/maxr1998/pulse4k/keymaps/default/keymap.c')
-rw-r--r--keyboards/maxr1998/pulse4k/keymaps/default/keymap.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
index 1ed4b5f1a..243a96ba7 100644
--- a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
+++ b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c
@@ -21,6 +21,10 @@ enum layers {
21 DEFAULT 21 DEFAULT
22}; 22};
23 23
24enum combo_events {
25 LED_ADJUST
26};
27
24const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END}; 28const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END};
25 29
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -29,3 +33,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 KC_LEFT, KC_DOWN, KC_RGHT 33 KC_LEFT, KC_DOWN, KC_RGHT
30 ) 34 )
31}; 35};
36
37combo_t key_combos[COMBO_COUNT] = {
38 [LED_ADJUST] = COMBO_ACTION(led_adjust_combo)
39};
40
41bool led_adjust_active = false;
42
43void process_combo_event(uint16_t combo_index, bool pressed) {
44 if (combo_index == LED_ADJUST) {
45 led_adjust_active = pressed;
46 }
47}
48
49bool encoder_update_user(uint8_t index, bool clockwise) {
50 if (index == 0) {
51 if (led_adjust_active) {
52 if (clockwise) {
53 rgblight_increase_val();
54 } else {
55 rgblight_decrease_val();
56 }
57 return false;
58 }
59 } else if (index == 1) {
60 if (led_adjust_active) {
61 if (clockwise) {
62 rgblight_increase_hue();
63 } else {
64 rgblight_decrease_hue();
65 }
66 return false;
67 }
68 }
69
70 return true;
71}