diff options
author | QMK Bot <hello@qmk.fm> | 2022-02-11 02:31:55 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-02-11 02:31:55 +0000 |
commit | 8106697a42d1068a98d3fdd65a64c10afcfbfbf5 (patch) | |
tree | 0de4adcb05b6ce3b2a3d3496f7fcdca5637dd3d1 | |
parent | cc7d3b75d774e688c9dac57898e1035445b31fc4 (diff) | |
parent | 2bc4a216dfbb83a6d2b57da397d370210087cff5 (diff) |
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r-- | keyboards/maxr1998/pulse4k/keymaps/default/keymap.c | 40 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/keymaps/default/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/keymaps/maxr1998/keymap.c | 40 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/keymaps/maxr1998/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/pulse4k.c | 36 | ||||
-rw-r--r-- | keyboards/maxr1998/pulse4k/rules.mk | 1 |
6 files changed, 85 insertions, 34 deletions
diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c index 1ed4b5f1af..243a96ba74 100644 --- a/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c +++ b/keyboards/maxr1998/pulse4k/keymaps/default/keymap.c @@ -21,6 +21,10 @@ enum layers { DEFAULT }; +enum combo_events { + LED_ADJUST +}; + const uint16_t PROGMEM led_adjust_combo[] = {KC_LEFT, KC_RGHT, COMBO_END}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -29,3 +33,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LEFT, KC_DOWN, KC_RGHT ) }; + +combo_t key_combos[COMBO_COUNT] = { + [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) +}; + +bool led_adjust_active = false; + +void process_combo_event(uint16_t combo_index, bool pressed) { + if (combo_index == LED_ADJUST) { + led_adjust_active = pressed; + } +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + return false; + } + } else if (index == 1) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + return false; + } + } + + return true; +} diff --git a/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk b/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk new file mode 100644 index 0000000000..ab1e438182 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/keymaps/default/rules.mk @@ -0,0 +1 @@ +COMBO_ENABLE = yes diff --git a/keyboards/maxr1998/pulse4k/keymaps/maxr1998/keymap.c b/keyboards/maxr1998/pulse4k/keymaps/maxr1998/keymap.c index 9eec3f0ae7..2aad1fa346 100644 --- a/keyboards/maxr1998/pulse4k/keymaps/maxr1998/keymap.c +++ b/keyboards/maxr1998/pulse4k/keymaps/maxr1998/keymap.c @@ -21,6 +21,10 @@ enum layers { DEFAULT }; +enum combo_events { + LED_ADJUST +}; + const uint16_t PROGMEM led_adjust_combo[] = {KC_F22, KC_F24, COMBO_END}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -30,6 +34,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; +combo_t key_combos[COMBO_COUNT] = { + [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) +}; + +bool led_adjust_active = false; + +void process_combo_event(uint16_t combo_index, bool pressed) { + if (combo_index == LED_ADJUST) { + led_adjust_active = pressed; + } +} + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + return false; + } + } else if (index == 1) { + if (led_adjust_active) { + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + return false; + } + } + + return true; +} + void encoder_one_update(bool clockwise) { tap_code(!clockwise ? KC_F18 : KC_F19); } diff --git a/keyboards/maxr1998/pulse4k/keymaps/maxr1998/rules.mk b/keyboards/maxr1998/pulse4k/keymaps/maxr1998/rules.mk new file mode 100644 index 0000000000..ab1e438182 --- /dev/null +++ b/keyboards/maxr1998/pulse4k/keymaps/maxr1998/rules.mk @@ -0,0 +1 @@ +COMBO_ENABLE = yes diff --git a/keyboards/maxr1998/pulse4k/pulse4k.c b/keyboards/maxr1998/pulse4k/pulse4k.c index 21bbe5d68e..f31eb6db37 100644 --- a/keyboards/maxr1998/pulse4k/pulse4k.c +++ b/keyboards/maxr1998/pulse4k/pulse4k.c @@ -16,44 +16,14 @@ */ #include "pulse4k.h" -#include "rgblight.h" - -enum combo_events { - LED_ADJUST -}; - -extern const uint16_t PROGMEM led_adjust_combo[3]; - -combo_t key_combos[COMBO_COUNT] = { - [LED_ADJUST] = COMBO_ACTION(led_adjust_combo) -}; - -bool led_adjust_active = false; - -void process_combo_event(uint16_t combo_index, bool pressed) { - if (combo_index == LED_ADJUST) { - led_adjust_active = pressed; - } -} bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) return false; + if (index == 0) { - if (led_adjust_active) { - if (clockwise) { - rgblight_increase_val(); - } else { - rgblight_decrease_val(); - } - } else encoder_one_update(clockwise); + encoder_one_update(clockwise); } else if (index == 1) { - if (led_adjust_active) { - if (clockwise) { - rgblight_increase_hue(); - } else { - rgblight_decrease_hue(); - } - } else encoder_two_update(clockwise); + encoder_two_update(clockwise); } return true; } diff --git a/keyboards/maxr1998/pulse4k/rules.mk b/keyboards/maxr1998/pulse4k/rules.mk index 3cfa6867a8..5533ac6f35 100644 --- a/keyboards/maxr1998/pulse4k/rules.mk +++ b/keyboards/maxr1998/pulse4k/rules.mk @@ -13,7 +13,6 @@ ENCODER_ENABLE = yes # Rotary encoders EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration -COMBO_ENABLE = yes # Key combo feature NKRO_ENABLE = yes # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output |