diff options
author | QMK Bot <hello@qmk.fm> | 2021-09-02 03:43:04 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-09-02 03:43:04 +0000 |
commit | 7847acdded30de74140cf398ea74203180c7e49f (patch) | |
tree | f5e95763d5f15015e67b1ab795734b6946d997a8 /users/jonavin/jonavin.c | |
parent | b0104e99a5effa2a0bd9faeafb9963dcb53cb2cd (diff) | |
parent | b6ca21c65c0d32241ed697072292bd5118b64f9a (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'users/jonavin/jonavin.c')
-rw-r--r-- | users/jonavin/jonavin.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/users/jonavin/jonavin.c b/users/jonavin/jonavin.c index d5fdb2a1eb..bd6c55e9fe 100644 --- a/users/jonavin/jonavin.c +++ b/users/jonavin/jonavin.c @@ -45,6 +45,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. }; #endif // TD_LSFT_CAPSLOCK_ENABLE +// RGB NIGHT MODE +#ifdef RGB_MATRIX_ENABLE + static bool rgb_nightmode = false; + + // Turn on/off NUM LOCK if current state is different + void activate_rgb_nightmode (bool turn_on) { + if (rgb_nightmode != turn_on) { + rgb_nightmode = !rgb_nightmode; + } + } + + bool get_rgb_nightmode(void) { + return rgb_nightmode; + } +#endif // RGB_MATRIX_ENABLE + // TIMEOUTS #ifdef IDLE_TIMEOUT_ENABLE static uint16_t timeout_timer = 0; @@ -192,7 +208,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else unregister_code16(keycode); break; #endif // IDLE_TIMEOUT_ENABLE - +#ifdef RGB_MATRIX_ENABLE + case RGB_NITE: + if(record->event.pressed) { + rgb_nightmode = !rgb_nightmode; + } else unregister_code16(keycode); + break; +#endif // RGB_MATRIX_ENABLE default: if (record->event.pressed) { #ifdef RGB_MATRIX_ENABLE |