diff options
author | HorrorTroll <sonicvipduc@gmail.com> | 2023-04-03 05:24:04 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 08:24:04 +1000 |
commit | d3008110096db2ac098db9b5cb47ad77582c01d9 (patch) | |
tree | f31fa3ba7481f3621faec10e87ab4eef2fdf9e50 /keyboards/gopolar/gg86/keymaps/bongocat | |
parent | 27e6e27d3a2ff9d91bcf0f189cdc39509bef0335 (diff) |
Add user horrortroll in userspace (#19769)
Diffstat (limited to 'keyboards/gopolar/gg86/keymaps/bongocat')
-rw-r--r-- | keyboards/gopolar/gg86/keymaps/bongocat/keymap.c | 111 | ||||
-rw-r--r-- | keyboards/gopolar/gg86/keymaps/bongocat/readme.md | 2 |
2 files changed, 1 insertions, 112 deletions
diff --git a/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c b/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c index 454d346f18..e0c17f868a 100644 --- a/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c +++ b/keyboards/gopolar/gg86/keymaps/bongocat/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2021 HorrorTroll <https://github.com/HorrorTroll> +/* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,11 +19,6 @@ // OLED animation #include "oled/bongocat.h" -#include <string.h> -#include <math.h> - -#include <lib/lib8tion/lib8tion.h> - // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -34,22 +29,6 @@ enum layer_names { _FN, }; -enum user_rgb_mode { - RGB_MODE_ALL, - RGB_MODE_KEYLIGHT, - RGB_MODE_UNDERGLOW, - RGB_MODE_NONE, -}; - -typedef union { - uint32_t raw; - struct { - uint8_t rgb_mode :8; - }; -} user_config_t; - -user_config_t user_config; - // enum layer_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -121,94 +100,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); - switch (user_config.rgb_mode) { - case RGB_MODE_ALL: - rgb_matrix_set_flags(LED_FLAG_ALL); - rgb_matrix_enable_noeeprom(); - break; - case RGB_MODE_KEYLIGHT: - rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); - rgb_matrix_set_color_all(0, 0, 0); - break; - case RGB_MODE_UNDERGLOW: - rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); - rgb_matrix_set_color_all(0, 0, 0); - break; - case RGB_MODE_NONE: - rgb_matrix_set_flags(LED_FLAG_NONE); - rgb_matrix_set_color_all(0, 0, 0); - break; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RGB_TOG: - if (record->event.pressed) { - switch (rgb_matrix_get_flags()) { - case LED_FLAG_ALL: { - rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR); - rgb_matrix_set_color_all(0, 0, 0); - user_config.rgb_mode = RGB_MODE_KEYLIGHT; - } - break; - case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): { - rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); - rgb_matrix_set_color_all(0, 0, 0); - user_config.rgb_mode = RGB_MODE_UNDERGLOW; - } - break; - case (LED_FLAG_UNDERGLOW): { - rgb_matrix_set_flags(LED_FLAG_NONE); - rgb_matrix_set_color_all(0, 0, 0); - user_config.rgb_mode = RGB_MODE_NONE; - } - break; - default: { - rgb_matrix_set_flags(LED_FLAG_ALL); - rgb_matrix_enable_noeeprom(); - user_config.rgb_mode = RGB_MODE_ALL; - } - break; - } - eeconfig_update_user(user_config.raw); - } - return false; - } - - return true; -} - -bool rgb_matrix_indicators_user(void) { - HSV hsv = rgb_matrix_config.hsv; - uint8_t time = scale16by8(g_rgb_timer, qadd8(32, 1)); - hsv.h = time; - RGB rgb = hsv_to_rgb(hsv); - - if ((rgb_matrix_get_flags() & LED_FLAG_KEYLIGHT)) { - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); - } - if (host_keyboard_led_state().scroll_lock) { - rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); - } - } else { - if (host_keyboard_led_state().caps_lock) { - rgb_matrix_set_color(25, rgb.r, rgb.g, rgb.b); - } else { - rgb_matrix_set_color(25, 0, 0, 0); - } - if (host_keyboard_led_state().scroll_lock) { - rgb_matrix_set_color(73, rgb.r, rgb.g, rgb.b); - } else { - rgb_matrix_set_color(73, 0, 0, 0); - } - } - return false; -} - #ifdef OLED_ENABLE bool oled_task_user(void) { led_t led_usb_state = host_keyboard_led_state(); diff --git a/keyboards/gopolar/gg86/keymaps/bongocat/readme.md b/keyboards/gopolar/gg86/keymaps/bongocat/readme.md index 632f9c67e2..9e02220c4c 100644 --- a/keyboards/gopolar/gg86/keymaps/bongocat/readme.md +++ b/keyboards/gopolar/gg86/keymaps/bongocat/readme.md @@ -1,3 +1 @@ # Keymap with VIA and Bongo Cat on OLED - -Keymap is default 87 qwerty, with TKL 7u-spacebar layout |