diff options
author | Nick Brassel <nick@tzarc.org> | 2023-11-28 16:39:48 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2023-11-28 16:40:47 +1100 |
commit | 0115951de12bd4c798a43a380651c34552552e85 (patch) | |
tree | 62999011ae782d93aa6dc9c889615db2a840cafc /users/mattly/mattly.c | |
parent | 0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff) | |
parent | 4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff) |
`develop` -> `master`, 2023q4 edition
Diffstat (limited to 'users/mattly/mattly.c')
-rw-r--r-- | users/mattly/mattly.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/users/mattly/mattly.c b/users/mattly/mattly.c deleted file mode 100644 index 9e8e7cfc97..0000000000 --- a/users/mattly/mattly.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "mattly.h" - -__attribute__ ((weak)) -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 (host_keyboard_led_state().caps_lock) { - rgblight_sethsv_noeeprom(HSV_CAPS); - } else { - 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 (get_highest_layer(state)) { - case _SYMBOL: - rgblight_sethsv_noeeprom(HSV_SYMBOL); - break; - case _NAVNUM: - case _NAVNUM_WIN: - rgblight_sethsv_noeeprom(HSV_NAVNUM); - break; - case _GAME: - rgblight_sethsv_noeeprom(HSV_GAME); - 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); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_CAPS: - #ifdef RGBLIGHT_ENABLE - set_lights_default(); - #endif - return true; - case QK_BOOT: - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv_noeeprom(HSV_RESET); - #endif - return true; - default: - return true; - } -} - -void keyboard_post_init_user(void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - set_lights_default(); -#endif -} |