summaryrefslogtreecommitdiffstats
path: root/keyboards/nyquist
diff options
context:
space:
mode:
authorPittyolo <kovacspitti@gmail.com>2018-02-13 12:04:27 +0100
committerJack Humbert <jack.humb@gmail.com>2018-02-16 18:02:14 +0100
commit7b5c6a895e998870d3a898847f89e78d9ae71224 (patch)
tree429edb9bf0b2ff84cd7f651f21d1884790be4b77 /keyboards/nyquist
parent4f55a7aca16f27d9f79019cf44d256dd98f71033 (diff)
downloadqmk_firmware-7b5c6a895e998870d3a898847f89e78d9ae71224.tar.gz
qmk_firmware-7b5c6a895e998870d3a898847f89e78d9ae71224.tar.xz
Update keymap.c
Diffstat (limited to 'keyboards/nyquist')
-rw-r--r--keyboards/nyquist/keymaps/pitty/keymap.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/keyboards/nyquist/keymaps/pitty/keymap.c b/keyboards/nyquist/keymaps/pitty/keymap.c
index 89f915192..fcdbc946d 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;
+}