aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Shaw <cory.shaw.dev@gmail.com>2017-10-03 15:05:10 -0400
committerJack Humbert <jack.humb@gmail.com>2017-10-03 09:05:10 -1000
commit01bf8e1643eea8178331722e51865ce22423bde1 (patch)
tree1ffa0574eb4f3d706169b18eb9f6e020ee8920ff
parent03de0c85754673500f4cee91e915743477c0d6f0 (diff)
downloadqmk_firmware-01bf8e1643eea8178331722e51865ce22423bde1.tar.gz
qmk_firmware-01bf8e1643eea8178331722e51865ce22423bde1.zip
Mbsurfer Let's Split keymap updates (#1787)
* Fix mbsurfer let's split layout RGB indicators when both lower and raise are pressed * Update mbsurfer let's split keymap with new RGB key codes for modes * Clean up mbsurfer keymap matrix layout
-rw-r--r--keyboards/lets_split/keymaps/mbsurfer/keymap.c87
1 files changed, 57 insertions, 30 deletions
diff --git a/keyboards/lets_split/keymaps/mbsurfer/keymap.c b/keyboards/lets_split/keymaps/mbsurfer/keymap.c
index b51abf258..0c20f3db3 100644
--- a/keyboards/lets_split/keymaps/mbsurfer/keymap.c
+++ b/keyboards/lets_split/keymaps/mbsurfer/keymap.c
@@ -110,10 +110,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
110 * `------------------------------------------ ------------------------------------------' 110 * `------------------------------------------ ------------------------------------------'
111 */ 111 */
112[_LOWER] = KEYMAP( \ 112[_LOWER] = KEYMAP( \
113 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ 113 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
114 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ 114 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
115 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_END, KC_HOME, _______, \ 115 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______, \
116 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ 116 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
117), 117),
118 118
119/* Raise 119/* Raise
@@ -136,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
136 136
137/* Adjust (Lower + Raise) 137/* Adjust (Lower + Raise)
138 * ,------------------------------------------ ------------------------------------------. 138 * ,------------------------------------------ ------------------------------------------.
139 * | | Reset| | | | | | | | | | | Del | 139 * | Reset| | Plain|Breath|Rainbw| Swirl| | Snake|Knight| Xmas |Grdent| | Del |
140 * |------+------+------+------+------+------- -------+------+------+------+------+------| 140 * |------+------+------+------+------+------- -------+------+------+------+------+------|
141 * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | 141 * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | |
142 * |------+------+------+------+------+------- -------+------+------+------+------+------| 142 * |------+------+------+------+------+------- -------+------+------+------+------+------|
@@ -146,10 +146,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
146 * `------------------------------------------ ------------------------------------------' 146 * `------------------------------------------ ------------------------------------------'
147 */ 147 */
148[_ADJUST] = KEYMAP( \ 148[_ADJUST] = KEYMAP( \
149 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ 149 RESET, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, KC_DEL, \
150 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ 150 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
151 _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ 151 _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \
152 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_S_ESC, C_A_DEL \ 152 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_S_ESC, C_A_DEL \
153) 153)
154 154
155 155
@@ -193,45 +193,72 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
193 break; 193 break;
194 case LOWER: 194 case LOWER:
195 if (record->event.pressed) { 195 if (record->event.pressed) {
196
197 if (IS_LAYER_OFF(_RAISE) && IS_LAYER_OFF(_ADJUST)) {
198 // Save current RGB info
199 RGB_current_mode = rgblight_config.mode;
200 RGB_current_hue = rgblight_config.hue;
201
202 // Set RGB to Blue
203 rgblight_mode(1);
204 rgblight_setrgb(0, 0, 255);
205 }
206
196 layer_on(_LOWER); 207 layer_on(_LOWER);
197 update_tri_layer(_LOWER, _RAISE, _ADJUST); 208 update_tri_layer(_LOWER, _RAISE, _ADJUST);
198 209
199 // Save current RGB info 210 if (IS_LAYER_ON(_ADJUST)){
200 RGB_current_mode = rgblight_config.mode; 211 // Set RGB to cyan
201 RGB_current_hue = rgblight_config.hue; 212 rgblight_setrgb(0, 255, 255);
202 213 }
203 // Set RGB to Blue
204 rgblight_mode(1);
205 rgblight_setrgb(0, 0, 254);
206 } else { 214 } else {
215
207 layer_off(_LOWER); 216 layer_off(_LOWER);
208 update_tri_layer(_LOWER, _RAISE, _ADJUST); 217 update_tri_layer(_LOWER, _RAISE, _ADJUST);
209 218
210 // Reset RGB 219 if (IS_LAYER_OFF(_RAISE) && IS_LAYER_OFF(_ADJUST)) {
211 rgblight_mode(RGB_current_mode); 220 // Reset RGB
212 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); 221 rgblight_mode(RGB_current_mode);
222 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
223 } else if (IS_LAYER_ON(_RAISE)){
224 // Set RGB to Red
225 rgblight_setrgb(0, 255, 0);
226 }
213 } 227 }
214 return false; 228 return false;
215 break; 229 break;
216 case RAISE: 230 case RAISE:
217 if (record->event.pressed) { 231 if (record->event.pressed) {
232
233 if (IS_LAYER_OFF(_LOWER) && IS_LAYER_OFF(_ADJUST)) {
234 // Save current RGB info
235 RGB_current_mode = rgblight_config.mode;
236 RGB_current_hue = rgblight_config.hue;
237
238 // Set RGB to Green
239 rgblight_mode(1);
240 rgblight_setrgb(0, 255, 0);
241 }
242
218 layer_on(_RAISE); 243 layer_on(_RAISE);
219 update_tri_layer(_LOWER, _RAISE, _ADJUST); 244 update_tri_layer(_LOWER, _RAISE, _ADJUST);
220 245
221 // Save current RGB info 246 if (IS_LAYER_ON(_ADJUST)){
222 RGB_current_mode = rgblight_config.mode; 247 // Set RGB to cyan
223 RGB_current_hue = rgblight_config.hue; 248 rgblight_setrgb(0, 255, 255);
224 249 }
225 // Set RGB to Green
226 rgblight_mode(1);
227 rgblight_setrgb(0, 254, 0);
228 } else { 250 } else {
229 layer_off(_RAISE); 251 layer_off(_RAISE);
230 update_tri_layer(_LOWER, _RAISE, _ADJUST); 252 update_tri_layer(_LOWER, _RAISE, _ADJUST);
231 253
232 // Reset RGB 254 if (IS_LAYER_OFF(_LOWER) && IS_LAYER_OFF(_ADJUST)) {
233 rgblight_mode(RGB_current_mode); 255 // Reset RGB
234 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); 256 rgblight_mode(RGB_current_mode);
257 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
258 } else if (IS_LAYER_ON(_LOWER)){
259 // Set RGB to Blue
260 rgblight_setrgb(0, 0, 255);
261 }
235 } 262 }
236 return false; 263 return false;
237 break; 264 break;
@@ -245,4 +272,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
245 break; 272 break;
246 } 273 }
247 return true; 274 return true;
248} 275} \ No newline at end of file