aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox/keymaps/erez_experimental/keymap.c24
-rw-r--r--quantum/rgblight.c7
-rw-r--r--quantum/rgblight.h1
3 files changed, 31 insertions, 1 deletions
diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c
index b867d3601..4a23c7ac5 100644
--- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c
+++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c
@@ -7,6 +7,12 @@
7#define SYMB 1 // symbols 7#define SYMB 1 // symbols
8#define MDIA 2 // media keys 8#define MDIA 2 // media keys
9 9
10enum custom_keycodes {
11 PLACEHOLDER = SAFE_RANGE, // can always be here
12 RGB_FF00BB // always start with RGB_
13};
14
15
10const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
11/* Keymap 0: Basic layer 17/* Keymap 0: Basic layer
12 * 18 *
@@ -75,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75// SYMBOLS 81// SYMBOLS
76[SYMB] = KEYMAP( 82[SYMB] = KEYMAP(
77 // left hand 83 // left hand
78 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, 84 RGB_FF00BB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
79 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 85 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
80 KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, 86 KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5,
81 KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, 87 KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
@@ -152,6 +158,22 @@ void matrix_init_user(void) {
152 158
153}; 159};
154 160
161
162bool process_record_user(uint16_t keycode, keyrecord_t *record) {
163 switch (keycode) {
164 // dynamically generate these.
165 case RGB_FF00BB:
166 if (record->event.pressed) {
167 rgblight_enable();
168 rgblight_mode(1);
169 rgblight_setrgb(0xff,0x00,0xbb);
170 }
171 return false;
172 break;
173 }
174 return true;
175}
176
155LEADER_EXTERNS(); 177LEADER_EXTERNS();
156 178
157// Runs constantly in the background, in a loop. 179// Runs constantly in the background, in a loop.
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 6b58f6654..00620da58 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -253,6 +253,13 @@ void rgblight_toggle(void) {
253 } 253 }
254} 254}
255 255
256void rgblight_enable(void) {
257 rgblight_config.enable = 1;
258 eeconfig_update_rgblight(rgblight_config.raw);
259 xprintf("rgblight enable: rgblight_config.enable = %u\n", rgblight_config.enable);
260 rgblight_mode(rgblight_config.mode);
261}
262
256 263
257void rgblight_increase_hue(void) { 264void rgblight_increase_hue(void) {
258 uint16_t hue; 265 uint16_t hue;
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index 330c2fe1b..a3673348e 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -61,6 +61,7 @@ void rgblight_init(void);
61void rgblight_increase(void); 61void rgblight_increase(void);
62void rgblight_decrease(void); 62void rgblight_decrease(void);
63void rgblight_toggle(void); 63void rgblight_toggle(void);
64void rgblight_enable(void);
64void rgblight_step(void); 65void rgblight_step(void);
65void rgblight_mode(uint8_t mode); 66void rgblight_mode(uint8_t mode);
66void rgblight_set(void); 67void rgblight_set(void);