summaryrefslogtreecommitdiffstats
path: root/users/mattly/mattly.c
diff options
context:
space:
mode:
authorMatthew Lyon <matthew@lyonheart.us>2020-07-21 17:08:56 -0700
committerGitHub <noreply@github.com>2020-07-21 17:08:56 -0700
commit3f96b88e73ea72474d841c1318c62b570f4aaf34 (patch)
tree9e3871d57e3f73ecfa0c71cd30cb802668c4d6ec /users/mattly/mattly.c
parent5e812cc4bea41688a7dd7cfc228cc5bc0cf23617 (diff)
mattly goes windows (#9677)
* mattly's userspace and iris * [Keymap] mattly's windows overlays * biton32->get_highest_layer * few more small tweaks
Diffstat (limited to 'users/mattly/mattly.c')
-rw-r--r--users/mattly/mattly.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c
index 1e61e01265..d097c8cd7b 100644
--- a/users/mattly/mattly.c
+++ b/users/mattly/mattly.c
@@ -5,48 +5,51 @@ layer_state_t layer_state_set_keymap (layer_state_t state) {
return state;
}
+static uint16_t current_state = 0;
+
void set_lights_default(void) {
#ifdef RGBLIGHT_ENABLE
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
rgblight_sethsv_noeeprom(HSV_CAPS);
} else {
- rgblight_sethsv_noeeprom(HSV_DEFAULT);
+ if (current_state == _BASE_MAC) {
+ rgblight_sethsv_noeeprom(HSV_MAC);
+ } else if (current_state == _OVER_WIN) {
+ rgblight_sethsv_noeeprom(HSV_WIN);
+ }
}
#endif
}
void layer_state_set_rgb(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
- switch (biton32(state)) {
- case _QWERTY:
- set_lights_default();
- break;
+ switch (get_highest_layer(state)) {
case _SYMBOL:
rgblight_sethsv_noeeprom(HSV_SYMBOL);
break;
case _NAVNUM:
+ case _NAVNUM_WIN:
rgblight_sethsv_noeeprom(HSV_NAVNUM);
break;
case _FUNCT:
+ case _FUNCT_WIN:
rgblight_sethsv_noeeprom(HSV_FUNCT);
break;
+ default:
+ set_lights_default();
}
#endif
}
-
layer_state_t layer_state_set_user (layer_state_t state) {
state = update_tri_layer_state(state, _SYMBOL, _NAVNUM, _FUNCT);
+ state = update_tri_layer_state(state, _OVER_WIN, _NAVNUM, _NAVNUM_WIN);
+ state = update_tri_layer_state(state, _OVER_WIN, _FUNCT, _FUNCT_WIN);
+ current_state = get_highest_layer(state);
layer_state_set_rgb(state);
return layer_state_set_keymap (state);
}
-void on_reset(void) {
- #ifdef RGBLIGHT_ENABLE
- rgblight_sethsv_noeeprom(HSV_RESET);
- #endif
-}
-
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_CAPS:
@@ -55,7 +58,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
return true;
case RESET:
- on_reset();
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_sethsv_noeeprom(HSV_RESET);
+ #endif
return true;
default:
return true;