diff options
author | jonavin <71780717+Jonavin@users.noreply.github.com> | 2021-09-01 23:42:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 20:42:31 -0700 |
commit | b6ca21c65c0d32241ed697072292bd5118b64f9a (patch) | |
tree | 396968fab42790ca62bdfb054aff9fc88a984aca /users/jonavin | |
parent | cded3b75821547cd69614ab8b4a71417b6fa4bcb (diff) |
[Keymap] Jonavin keymap gmmk pro (#14220)
add rgb nightmode and optional colemak layer
Co-authored-by: Jonavin <=>
Diffstat (limited to 'users/jonavin')
-rw-r--r-- | users/jonavin/jonavin.c | 24 | ||||
-rw-r--r-- | users/jonavin/jonavin.h | 5 | ||||
-rw-r--r-- | users/jonavin/rules.mk | 3 |
3 files changed, 30 insertions, 2 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 diff --git a/users/jonavin/jonavin.h b/users/jonavin/jonavin.h index 894feddfd9..5f467bc845 100644 --- a/users/jonavin/jonavin.h +++ b/users/jonavin/jonavin.h @@ -36,6 +36,7 @@ enum custom_user_keycodes { KC_WINLCK, //Toggles Win key on and off RGB_TOI, // Timeout idle time up RGB_TOD, // Timeout idle time down + RGB_NITE // Turns off all rgb but allow rgb indicators to work }; #define KC_CAD LALT(LCTL(KC_DEL)) @@ -57,11 +58,13 @@ enum custom_user_keycodes { #endif // TD_LSFT_CAPSLOCK_ENABLE - #ifdef RGB_MATRIX_ENABLE //RGB custom colours #define RGB_GODSPEED 0x00, 0xE4, 0xFF // colour for matching keycaps #define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Nautilus Font colours + + void activate_rgb_nightmode (bool turn_on); + bool get_rgb_nightmode(void); #endif diff --git a/users/jonavin/rules.mk b/users/jonavin/rules.mk index 4e9ee08ff7..e2918d9e26 100644 --- a/users/jonavin/rules.mk +++ b/users/jonavin/rules.mk @@ -11,3 +11,6 @@ endif ifeq ($(strip $(STARTUP_NUMLOCK_ON)), yes) OPT_DEFS += -DSTARTUP_NUMLOCK_ON endif +ifeq ($(strip $(COLEMAK_LAYER_ENABLE)), yes) + OPT_DEFS += -DCOLEMAK_LAYER_ENABLE +endif |