diff options
author | Pittyolo <kovacspitti@gmail.com> | 2018-02-13 12:04:27 +0100 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-02-16 12:02:14 -0500 |
commit | 7b5c6a895e998870d3a898847f89e78d9ae71224 (patch) | |
tree | 429edb9bf0b2ff84cd7f651f21d1884790be4b77 /keyboards/nyquist/keymaps/pitty | |
parent | 4f55a7aca16f27d9f79019cf44d256dd98f71033 (diff) | |
download | qmk_firmware-7b5c6a895e998870d3a898847f89e78d9ae71224.tar.gz qmk_firmware-7b5c6a895e998870d3a898847f89e78d9ae71224.zip |
Update keymap.c
Diffstat (limited to 'keyboards/nyquist/keymaps/pitty')
-rw-r--r-- | keyboards/nyquist/keymaps/pitty/keymap.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/keyboards/nyquist/keymaps/pitty/keymap.c b/keyboards/nyquist/keymaps/pitty/keymap.c index 89f9151927..fcdbc946d7 100644 --- a/keyboards/nyquist/keymaps/pitty/keymap.c +++ b/keyboards/nyquist/keymaps/pitty/keymap.c @@ -131,3 +131,45 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; } +#ifdef RGBLIGHT_ENABLE +bool rgb_layer_change = true; +#endif + +#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); +#define rgblight_set_red rgblight_sethsv (0x00, 0xFF, 0xFF); +#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); +#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); +#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); +#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); +#define rgblight_set_yellow rgblight_sethsv (0x3C, 0xFF, 0xFF); +#define rgblight_set_purple rgblight_sethsv (0x10E, 0xFF, 0xFF); +#define rgblight_set_white rgblight_sethsv (0x00, 0x00, 0xFF); +#define rgblight_set_black rgblight_sethsv (0x00, 0x00, 0x00); + +uint32_t layer_state_set_user(uint32_t state) { +#ifdef RGBLIGHT_ENABLE + uint8_t default_layer = eeconfig_read_default_layer(); + if (rgb_layer_change) { + switch (biton32(state)) { + case _LOWER: + rgblight_set_purple; + rgblight_mode(5); + break; + case _VIM: + rgblight_set_green; + rgblight_mode(23); + break; + case _GAME: + rgblight_mode(8); + break; + default: + if (default_layer & (1UL << _GAME)) { + } + else + rgblight_mode(14); + break; + } + } +#endif + return state; +} |