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
travis_phases
Cory Shaw 7 years ago committed by Jack Humbert
parent 03de0c8575
commit 01bf8e1643

@ -110,10 +110,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `------------------------------------------ ------------------------------------------' * `------------------------------------------ ------------------------------------------'
*/ */
[_LOWER] = KEYMAP( \ [_LOWER] = KEYMAP( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_END, KC_HOME, _______, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
), ),
/* Raise /* Raise
@ -136,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Adjust (Lower + Raise) /* Adjust (Lower + Raise)
* ,------------------------------------------ ------------------------------------------. * ,------------------------------------------ ------------------------------------------.
* | | Reset| | | | | | | | | | | Del | * | Reset| | Plain|Breath|Rainbw| Swirl| | Snake|Knight| Xmas |Grdent| | Del |
* |------+------+------+------+------+------- -------+------+------+------+------+------| * |------+------+------+------+------+------- -------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------- -------+------+------+------+------+------| * |------+------+------+------+------+------- -------+------+------+------+------+------|
@ -146,10 +146,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `------------------------------------------ ------------------------------------------' * `------------------------------------------ ------------------------------------------'
*/ */
[_ADJUST] = KEYMAP( \ [_ADJUST] = KEYMAP( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ 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, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_S_ESC, C_A_DEL \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_S_ESC, C_A_DEL \
) )
@ -193,45 +193,72 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
case LOWER: case LOWER:
if (record->event.pressed) { if (record->event.pressed) {
if (IS_LAYER_OFF(_RAISE) && IS_LAYER_OFF(_ADJUST)) {
// Save current RGB info
RGB_current_mode = rgblight_config.mode;
RGB_current_hue = rgblight_config.hue;
// Set RGB to Blue
rgblight_mode(1);
rgblight_setrgb(0, 0, 255);
}
layer_on(_LOWER); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
// Save current RGB info if (IS_LAYER_ON(_ADJUST)){
RGB_current_mode = rgblight_config.mode; // Set RGB to cyan
RGB_current_hue = rgblight_config.hue; rgblight_setrgb(0, 255, 255);
}
// Set RGB to Blue
rgblight_mode(1);
rgblight_setrgb(0, 0, 254);
} else { } else {
layer_off(_LOWER); layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
// Reset RGB if (IS_LAYER_OFF(_RAISE) && IS_LAYER_OFF(_ADJUST)) {
rgblight_mode(RGB_current_mode); // Reset RGB
rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); rgblight_mode(RGB_current_mode);
rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
} else if (IS_LAYER_ON(_RAISE)){
// Set RGB to Red
rgblight_setrgb(0, 255, 0);
}
} }
return false; return false;
break; break;
case RAISE: case RAISE:
if (record->event.pressed) { if (record->event.pressed) {
if (IS_LAYER_OFF(_LOWER) && IS_LAYER_OFF(_ADJUST)) {
// Save current RGB info
RGB_current_mode = rgblight_config.mode;
RGB_current_hue = rgblight_config.hue;
// Set RGB to Green
rgblight_mode(1);
rgblight_setrgb(0, 255, 0);
}
layer_on(_RAISE); layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
// Save current RGB info if (IS_LAYER_ON(_ADJUST)){
RGB_current_mode = rgblight_config.mode; // Set RGB to cyan
RGB_current_hue = rgblight_config.hue; rgblight_setrgb(0, 255, 255);
}
// Set RGB to Green
rgblight_mode(1);
rgblight_setrgb(0, 254, 0);
} else { } else {
layer_off(_RAISE); layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
// Reset RGB if (IS_LAYER_OFF(_LOWER) && IS_LAYER_OFF(_ADJUST)) {
rgblight_mode(RGB_current_mode); // Reset RGB
rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); rgblight_mode(RGB_current_mode);
rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
} else if (IS_LAYER_ON(_LOWER)){
// Set RGB to Blue
rgblight_setrgb(0, 0, 255);
}
} }
return false; return false;
break; break;

Loading…
Cancel
Save