[Keymap] Update to Userspace kuchosauronad0 (#6899)
* Add Plover layer, remove unused layers * Add rgb indicator for success/failed sequences * Add RGB effects * Add RGB * Add effects for start and end of a leader sequence * Add PLOVER layer * Add RGB * Add RBG * Minor clean up * Minor clean up * Minor clean up * Minor clean up * Rename rgb_light to rgblight_user and fix all references to it * Remove unnecessary guards Remove unnecessary matrix_scan in rgb post_init function * remove trailing newlinemaster
parent
b1c2bf071b
commit
674fcc474c
|
@ -1,22 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
# define DEFAULT_LAYER_SONGS \
|
||||
{ SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(PLOVER_SOUND) }
|
||||
# define AUDIO_CLICKY
|
||||
# define STARTUP_SONG SONG(RICK_ROLL)
|
||||
# define GOODBYE_SONG SONG(SONIC_RING)
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(COLEMAK_SOUND), \
|
||||
SONG(DVORAK_SOUND), \
|
||||
SONG(OVERWATCH_THEME) \
|
||||
}
|
||||
# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
|
||||
// #ifdef RGBLIGHT_ENABLE
|
||||
// #define NO_MUSIC_MODE
|
||||
// #endif //RGBLIGHT_ENABLE/
|
||||
// #ifndef __arm__
|
||||
// #undef NOTE_REST
|
||||
// #define NOTE_REST 1.00f
|
||||
// #endif // !__arm__
|
||||
# ifndef __arm__
|
||||
# undef NOTE_REST
|
||||
# define NOTE_REST 1.00f
|
||||
# endif // !__arm__
|
||||
# define UNICODE_SONG_OSX SONG(RICK_ROLL)
|
||||
# define UNICODE_SONG_LNX SONG(RICK_ROLL)
|
||||
# define UNICODE_SONG_WIN SONG(RICK_ROLL)
|
||||
|
@ -27,9 +21,16 @@
|
|||
#ifdef RGBLIGHT_ENABLE
|
||||
# define RGBLIGHT_SLEEP
|
||||
# undef RGBLIGHT_ANIMATIONS
|
||||
# define RGBLIGHT_HUE_STEP 16
|
||||
# define RGBLIGHT_SAT_STEP 16
|
||||
# define RGBLIGHT_VAL_STEP 16
|
||||
# define RGBLIGHT_LIMIT_VAL 255
|
||||
# define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
//# define RGBLIGHT_EFFECT_KNIGHT
|
||||
//# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
|
||||
//# define RGBLIGHT_EFFECT_SNAKE
|
||||
//# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
|
||||
#endif // !RGBLIGHT_ENABLE
|
||||
|
||||
#ifndef ONESHOT_TAP_TOGGLE
|
||||
|
@ -87,4 +88,3 @@
|
|||
|
||||
#define MACRO_TIMER 5
|
||||
|
||||
|
||||
|
|
|
@ -21,8 +21,7 @@ userspace_config_t userspace_config;
|
|||
#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
|
||||
# define KUCHOSAURONAD0_UNICODE_MODE UC_WINC
|
||||
#else
|
||||
// set to 2 for UC_WIN, set to 4 for UC_WINC
|
||||
#define KUCHOSAURONAD0_UNICODE_MODE 2
|
||||
# define KUCHOSAURONAD0_UNICODE_MODE 2 // set to 2 for UC_WIN, set to 4 for UC_WINC
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -70,7 +69,7 @@ void shutdown_user (void) {
|
|||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_mode_noeeprom(1);
|
||||
rgblight_setrgb_red();
|
||||
rgblight_setrgb_teal();
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// uint16_t timer_start = timer_read();
|
||||
|
@ -108,11 +107,11 @@ void matrix_scan_user(void){
|
|||
|
||||
#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
|
||||
// run_diablo_macro_check();
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
#endif // !TAP_DANCE_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
matrix_scan_rgb();
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#endif // !RGBLIGHT_ENABLE
|
||||
|
||||
matrix_scan_keymap();
|
||||
}
|
||||
|
@ -171,6 +170,8 @@ void eeconfig_init_user(void) {
|
|||
#else
|
||||
eeprom_update_byte(EECONFIG_UNICODEMODE, KUCHOSAURONAD0_UNICODE_MODE);
|
||||
#endif
|
||||
eeconfig_init_keymap();
|
||||
keyboard_init();
|
||||
}
|
||||
|
||||
// TMUX stuff
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
#ifndef USERSPACE
|
||||
#define USERSPACE
|
||||
|
||||
//#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
|
@ -19,15 +16,17 @@
|
|||
# define KC_PW TD(TD_PW) // tap1: 'b' tap2: <ALT>+b
|
||||
# define KC_DW TD(TD_DW) // tap1: 'w' tap2: <CTL>+w
|
||||
#endif //!TAP_DANCE_ENABLE
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
#include "rgb_stuff.h"
|
||||
# include "rgblight_user.h"
|
||||
#endif
|
||||
|
||||
#if defined(UNICODEMAP_ENABLE) || defined(UNICODE_ENABLE)
|
||||
# include "unicode.h"
|
||||
#endif //!UNICODE_ENABLE
|
||||
|
||||
// Keycode aliases
|
||||
#define TM_X LCTL(KC_B) // Tmux control sequence
|
||||
#define TM_X LCTL(KC_B) // Tmux leader key
|
||||
// Unix QoL macros
|
||||
#define MC_BOL LCTL(KC_A) // jump to beginning of line
|
||||
#define MC_EOL LCTL(KC_E) // jump to end of line
|
||||
|
@ -42,10 +41,11 @@ enum userspace_layers {
|
|||
_COLEMAK,
|
||||
_DVORAK,
|
||||
_WORKMAN,
|
||||
_NORMAN,
|
||||
/* _NORMAN,
|
||||
_MALTRON,
|
||||
_EUCALYN,
|
||||
_CARPLAX,
|
||||
_CARPLAX, */
|
||||
_PLOVER,
|
||||
_UNICODE,
|
||||
_MODS, /* layer 8 now 9*/
|
||||
_GAMEPAD,
|
||||
|
@ -99,13 +99,11 @@ We use custom codes here, so we can substitute the right stuff
|
|||
# define KC_D3_2 TD(TD_D3_2)
|
||||
# define KC_D3_3 TD(TD_D3_3)
|
||||
# define KC_D3_4 TD(TD_D3_4)
|
||||
#else // TAP_DANCE_ENABLE
|
||||
#else
|
||||
# define KC_D3_1 KC_1
|
||||
# define KC_D3_2 KC_2
|
||||
# define KC_D3_3 KC_3
|
||||
# define KC_D3_4 KC_4
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
#endif // !USERSPACE
|
||||
#endif // !TAP_DANCE_ENABLE
|
||||
|
||||
/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et */
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
#include "leader.h"
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
extern rgblight_config_t rgblight_config;
|
||||
#endif
|
||||
bool leader_succeed;
|
||||
|
||||
LEADER_EXTERNS();
|
||||
|
||||
|
@ -8,70 +12,105 @@ void matrix_scan_user(void){
|
|||
has_ran_yet = true;
|
||||
startup_user();
|
||||
}
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
|
||||
// run_diablo_macro_check();
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
#endif
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
matrix_scan_rgb();
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#endif
|
||||
LEADER_DICTIONARY() {
|
||||
leading = false;
|
||||
leader_end();
|
||||
leader_succeed = leading = false;
|
||||
|
||||
SEQ_ONE_KEY(KC_W) {
|
||||
// vim/tmux: Use in command mode in vim: write to file, switch tmux pane in the current session window and repeat the last command
|
||||
SEND_STRING(":w" SS_TAP(X_ENTER));
|
||||
tmux_pane_switch_repeat();
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_ONE_KEY(KC_T) {
|
||||
// Send the Tmux Prefix
|
||||
tmux_prefix();
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_ONE_KEY(KC_A) {
|
||||
// tmux: Send the prefix and press 'right' arrow
|
||||
tmux_prefix();
|
||||
tap_code(KC_RIGHT);
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_T, KC_T) {
|
||||
// tmux: Send the prefix to a nested session
|
||||
tmux_prefix();
|
||||
tmux_prefix();
|
||||
}
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_T, KC_R) {
|
||||
// tmux: Switch pane and repeat last action
|
||||
tmux_pane_switch_repeat();
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_V, KC_Z){
|
||||
// vim: Zoom pane
|
||||
tap_code16(LCTL(KC_W));
|
||||
tap_code16(LSFT(KC_BSLS));
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_V, KC_R) {
|
||||
// vim: Substitute and place cursor
|
||||
SEND_STRING(":%s///g" SS_TAP(X_LEFT));
|
||||
tap_code(KC_LEFT);
|
||||
tap_code(KC_LEFT);
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_V, KC_T) {
|
||||
// vim: move current pane to new tab
|
||||
tap_code16(LCTL(KC_W));
|
||||
tap_code16(LSFT(KC_T));
|
||||
}
|
||||
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_ONE_KEY(KC_R){
|
||||
// Toggle RGB Layer indicator
|
||||
tap_code16(KC_RGB_T);
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_ONE_KEY(KC_SPC){
|
||||
// One Shot Unicode layer
|
||||
//TODO tap_code16(OS_UNI);
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_TWO_KEYS(KC_SPC, KC_SPC){
|
||||
// Toggle _MODS
|
||||
tap_code16(TG_MODS);
|
||||
leader_succeed = true;
|
||||
} else
|
||||
SEQ_THREE_KEYS(KC_BSPC, KC_BSPC, KC_BSPC){
|
||||
// Reset the keyboard
|
||||
reset_keyboard();
|
||||
leader_succeed = true;
|
||||
}
|
||||
leader_end();
|
||||
}
|
||||
// matrix_scan_keymap();
|
||||
}
|
||||
|
||||
matrix_scan_keymap();
|
||||
void leader_start(void) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_savebase();
|
||||
rgblight_mode_noeeprom(1);
|
||||
rgblight_sethsv_noeeprom_goldenrod();
|
||||
#endif
|
||||
}
|
||||
|
||||
void leader_end(void) {
|
||||
// pick color depending of success /fail
|
||||
// fade leader_start from 100 to 0
|
||||
// fade new color from 0 to 100 to 0
|
||||
// fade old color from 0 to 100
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (leader_succeed) {
|
||||
fadeflash_leds(HSV_GREEN);
|
||||
} else {
|
||||
fadeflash_leds(HSV_RED);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
#endif //KEYLOGGER_ENABLE
|
||||
|
||||
switch (keycode) {
|
||||
case KC_QWERTY ... KC_UNICODE:
|
||||
case KC_QWERTY ... KC_PLOVER:
|
||||
if (record->event.pressed) {
|
||||
set_single_persistent_default_layer(keycode - KC_QWERTY);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
|
||||
if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); }
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
|
||||
// userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
|
||||
#endif //RGBLIGHT_ENABLE
|
||||
break;
|
||||
case KC_SALT:
|
||||
|
|
|
@ -13,11 +13,7 @@ enum userspace_custom_keycodes{
|
|||
KC_COLEMAK, // Sets default layer to COLEMAK
|
||||
KC_DVORAK, // Sets default layer to DVORAK
|
||||
KC_WORKMAN, // Sets default layer to WORKMAN
|
||||
KC_NORMAN, // Sets default layer to NORMAN
|
||||
KC_MALTRON, // Sets default layer to MALTRON
|
||||
KC_EUCALYN, // Sets default layer to EUCALYN
|
||||
KC_CARPLAX, // Sets default layer to CARPLAX
|
||||
KC_UNICODE, // Sets default layer to UNICODE
|
||||
KC_PLOVER, // Sets default layer to PLOVER
|
||||
|
||||
KC_MAKE, // Run keyboard's customized make command
|
||||
KC_RGB_T, // Toggles RGB Layer Indication mode
|
||||
|
@ -63,6 +59,7 @@ enum userspace_custom_keycodes{
|
|||
};
|
||||
|
||||
bool process_record_secrets(uint16_t keycode, keyrecord_t *record);
|
||||
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
|
||||
|
||||
#define LOWER MO(_LOWER)
|
||||
|
@ -74,18 +71,18 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
|
|||
#define OS_RSE OSL(_RAISE)
|
||||
#define OS_UNI OSL(_UNICODE)
|
||||
|
||||
#define KC_SEC1 KC_SECRET_1
|
||||
#define KC_SEC2 KC_SECRET_2
|
||||
#define KC_SEC3 KC_SECRET_3
|
||||
#define KC_SEC4 KC_SECRET_4
|
||||
#define KC_SEC5 KC_SECRET_5
|
||||
#define KC_SEC6 KC_SECRET_6
|
||||
#define SEC1 KC_SECRET_1
|
||||
#define SEC2 KC_SECRET_2
|
||||
#define SEC3 KC_SECRET_3
|
||||
#define SEC4 KC_SECRET_4
|
||||
#define SEC5 KC_SECRET_5
|
||||
#define SEC6 KC_SECRET_6
|
||||
|
||||
#define QWERTY KC_QWERTY
|
||||
#define DVORAK KC_DVORAK
|
||||
#define COLEMAK KC_COLEMAK
|
||||
#define WORKMAN KC_WORKMAN
|
||||
#define UNICODE KC_UNICODE
|
||||
#define PLOVER KC_PLOVER
|
||||
|
||||
#define KC_RESET RESET
|
||||
#define KC_RST KC_RESET
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
#include "rgblight_user.h"
|
||||
extern rgblight_config_t rgblight_config;
|
||||
bool has_initialized;
|
||||
uint8_t base_hue; // Hue value of base state
|
||||
uint8_t base_sat; // Saturation value of base state
|
||||
uint8_t base_val; // Brightness value of base state
|
||||
uint8_t base_mod; // Animation mode of the base state
|
||||
|
||||
void rgblight_savebase(void) { // Save the current settings to ram
|
||||
base_hue = rgblight_config.hue;
|
||||
base_sat = rgblight_config.sat;
|
||||
base_val = rgblight_config.val;
|
||||
base_mod = rgblight_config.mode;
|
||||
}
|
||||
void rgblight_loadbase(void) { // Load settings from ram to eeprom
|
||||
rgblight_mode( base_mod );
|
||||
rgblight_sethsv_eeprom_helper(base_hue, base_sat, base_val, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
||||
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
|
||||
keycode = keycode & 0xFF;
|
||||
}
|
||||
switch (keycode) {
|
||||
case KC_RGB_T: // Switch between underglow layer indication and normal qmk behaviour
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
if (record->event.pressed) {
|
||||
userspace_config.rgb_layer_change ^= 1;
|
||||
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
layer_state_set(layer_state); // Immediately set the layer color (looks better)
|
||||
}
|
||||
}
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
return false;
|
||||
break;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions
|
||||
if (record->event.pressed) { // This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
userspace_config.rgb_layer_change = false;
|
||||
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void keyboard_post_init_rgb(void) {
|
||||
# if defined(RGBLIGHT_ENABLE) || defined(RGBLIGHT_STARTUP_ANIMATION)
|
||||
bool is_enabled = rgblight_config.enable;
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
rgblight_enable_noeeprom();
|
||||
}
|
||||
if (rgblight_config.enable) {
|
||||
layer_state_set_user(layer_state);
|
||||
uint16_t old_hue = rgblight_config.hue;
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
for (uint16_t i = 255; i > 0; i--) {
|
||||
rgblight_sethsv_noeeprom((i + old_hue) % 255, 255, 255);
|
||||
wait_ms(5);
|
||||
}
|
||||
}
|
||||
if (!is_enabled) {
|
||||
rgblight_disable_noeeprom();
|
||||
}
|
||||
# endif // !RGBLIGHT_ENABLE || RGBLIGHT_STARTUP_ANIMATION
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
void matrix_scan_rgb(void) {
|
||||
# ifdef INDICATOR_LIGHTS
|
||||
matrix_scan_indicator();
|
||||
# endif
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_rgb(layer_state_t state) {
|
||||
# ifdef RGBLIGHT_ENABLE
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
switch (biton32(state)) { // _RAISE, _LOWER and _ADJUST use a custom color and the breathing effect
|
||||
case _RAISE:
|
||||
rgblight_sethsv_noeeprom_green();
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
|
||||
break;
|
||||
case _LOWER:
|
||||
rgblight_sethsv_noeeprom_red();
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_sethsv_noeeprom_white();
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 2);
|
||||
break;
|
||||
default: // Use a solid color for normal layers
|
||||
switch (biton32(default_layer_state)) {
|
||||
case _QWERTY:
|
||||
rgblight_sethsv_noeeprom_magenta();
|
||||
break;
|
||||
case _COLEMAK:
|
||||
rgblight_sethsv_noeeprom_green();
|
||||
break;
|
||||
case _DVORAK:
|
||||
rgblight_sethsv_noeeprom_blue();
|
||||
break;
|
||||
case _WORKMAN:
|
||||
rgblight_sethsv_noeeprom_goldenrod();
|
||||
break;
|
||||
case _PLOVER:
|
||||
rgblight_sethsv_noeeprom_pink();
|
||||
break;
|
||||
default:
|
||||
rgblight_sethsv_noeeprom_white();
|
||||
break;
|
||||
}
|
||||
biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
|
||||
break;
|
||||
}
|
||||
}
|
||||
# endif // !RGBLIGHT_ENABLE
|
||||
return state;
|
||||
}
|
||||
|
||||
#ifdef INDICATOR_LIGHTS
|
||||
void matrix_scan_indicator(void) {
|
||||
if (has_initialized) {
|
||||
set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods());
|
||||
}
|
||||
}
|
||||
#endif // !INDICATOR_LIGHTS
|
||||
|
||||
void rgblight_fade_helper(bool direction){
|
||||
// true: increase val = fade in
|
||||
// false: decrease val = fade out
|
||||
for (uint8_t index = 0; index < RGBLIGHT_VAL_STEP ; index++) {
|
||||
direction ? rgblight_increase_val() : rgblight_decrease_val();
|
||||
wait_ms(5);
|
||||
}
|
||||
}
|
||||
void fadeflash_leds(uint8_t hue, uint8_t sat, uint8_t val){
|
||||
// indicate success / fail of a leader sequence
|
||||
// fade out, set new hue and saturation, fade in, fade out, set old color, fade in
|
||||
// this is used in leader.c
|
||||
// TODO: come up with a better name maybe
|
||||
rgblight_fade_helper(false);
|
||||
rgblight_sethsv_noeeprom(hue, sat, 0);
|
||||
rgblight_fade_helper(true);
|
||||
rgblight_fade_helper(false);
|
||||
rgblight_sethsv_noeeprom(base_hue, base_sat, 0);
|
||||
rgblight_fade_helper(true);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#pragma once
|
||||
#include "kuchosauronad0.h"
|
||||
|
||||
typedef struct {
|
||||
bool enabled;
|
||||
uint8_t hue;
|
||||
uint16_t timer;
|
||||
uint8_t life;
|
||||
} rgblight_fadeout;
|
||||
const uint8_t RGBLIGHT_FADE_SPEED[6] PROGMEM;
|
||||
|
||||
layer_state_t layer_state_set_rgb(layer_state_t state);
|
||||
layer_state_t default_layer_state_set_rgb(layer_state_t state);
|
||||
|
||||
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
|
||||
void scan_rgblight_fadeout(void);
|
||||
void keyboard_post_init_rgb(void);
|
||||
void matrix_scan_rgb(void);
|
||||
void rgblight_sethsv_default_helper(uint8_t index);
|
||||
void rgblight_savebase(void);
|
||||
void rgblight_loadbase(void);
|
||||
void rgblight_fade_helper(bool direction);
|
||||
void fadeflash_leds(uint8_t hue, uint8_t sat, uint8_t val);
|
|
@ -2,10 +2,11 @@ SRC += kuchosauronad0.c \
|
|||
process_records.c
|
||||
|
||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||
SPACE_CADET_ENABLE = no
|
||||
|
||||
#ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
|
||||
# SRC += secrets.c
|
||||
#endif
|
||||
ifneq ($(strip $(RGBLIGHT_ENABLE)),yes )
|
||||
SRC += rgblight_user.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
SRC += tap_dances.c
|
||||
|
@ -14,6 +15,7 @@ endif
|
|||
ifeq ($(strip $(ENCODER_ENABLE)), yes)
|
||||
SRC += encoder.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(COMBO_ENABLE)), yes)
|
||||
SRC += combo.c
|
||||
endif
|
||||
|
|
|
@ -16,6 +16,8 @@ expanded before being used as arguments to the LAYOUT_xxx macro.
|
|||
#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
|
||||
#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__)
|
||||
|
||||
#define LAYOUT_collide39_base_wrapper(...) LAYOUT_collide39_base(__VA_ARGS__)
|
||||
|
||||
/*
|
||||
Blocks for each of the four major keyboard layouts
|
||||
Organized so we can quickly adapt and modify all of them
|
||||
|
@ -26,6 +28,9 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
then you need to add/remove underscores to keep the
|
||||
lengths consistent.
|
||||
*/
|
||||
|
||||
#define ___________________BLANK___________________ _______, _______, _______, _______, _______
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
# define _________________QWERTY_L1_________________ KC_Q, KC_DW, KC_EOL, KC_R, KC_TMX
|
||||
# define _________________QWERTY_L2_________________ KC_BOL, KC_S, KC_D, KC_NW, KC_G
|
||||
|
@ -40,6 +45,13 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
|
||||
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
#define _________________PLOVER_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _________________PLOVER_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
|
||||
#define _________________PLOVER_L3_________________ KC_NO, KC_NO, KC_C, KC_V, KC_NO
|
||||
|
||||
#define _________________PLOVER_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
|
||||
#define _________________PLOVER_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
|
||||
#define _________________PLOVER_R3_________________ KC_NO, KC_NO, KC_N, KC_M, KC_NO
|
||||
|
||||
#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
|
||||
#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
|
||||
|
@ -57,7 +69,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O
|
||||
#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
|
||||
#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
|
||||
#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X
|
||||
|
@ -74,7 +85,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S
|
||||
#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z
|
||||
|
||||
|
||||
#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B
|
||||
#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G
|
||||
#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V
|
||||
|
@ -83,7 +93,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I
|
||||
#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K
|
||||
#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G
|
||||
#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
@ -92,7 +101,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U
|
||||
#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B
|
||||
#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F
|
||||
#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J, KC_G, KC_COMM
|
||||
|
@ -101,7 +109,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R
|
||||
#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X
|
||||
|
||||
|
||||
#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q
|
||||
#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U
|
||||
#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W
|
||||
|
@ -110,7 +117,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N
|
||||
#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN
|
||||
|
||||
|
||||
#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X
|
||||
|
@ -119,7 +125,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN
|
||||
#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
|
||||
#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J
|
||||
|
@ -128,7 +133,6 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H
|
||||
#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
|
||||
#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J
|
||||
|
@ -162,18 +166,16 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
|
||||
#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
|
||||
|
||||
#define ___________________BLANK___________________ _______, _______, _______, _______, _______
|
||||
|
||||
#define _________________MEDIA_RIGHT_______________ KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP
|
||||
#define _________________MEDIA_LEFT________________ KC_VOLD, KC_VOLD, KC_MUTE, KC_VOLU, KC_VOLU
|
||||
|
||||
#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
|
||||
#define _________________LOWER_L2__________________ ___________________BLANK___________________
|
||||
#define _________________LOWER_L3__________________ ___________________BLANK___________________
|
||||
#define _________________LOWER_L3__________________ _______, _______, _______, OS_UNI, TM_X
|
||||
|
||||
#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
|
||||
#define _________________LOWER_R2__________________ OS_UNI, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR
|
||||
#define _________________LOWER_R3__________________ TM_X, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
|
||||
|
||||
#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR
|
||||
#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
|
||||
#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________
|
||||
#define _________________RAISE_L2__________________ ___________________BLANK___________________
|
||||
|
@ -183,24 +185,28 @@ NOTE: These are all the same length. If you do a search/replace
|
|||
#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC
|
||||
#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
|
||||
|
||||
|
||||
|
||||
#define _________________ADJUST_L1_________________ ___________________BLANK___________________
|
||||
#define _________________ADJUST_L1_________________ QWERTY, COLEMAK, DVORAK, WORKMAN, PLOVER
|
||||
#define _________________ADJUST_L2_________________ _________________FUNC_LEFT_________________
|
||||
#define _________________ADJUST_L3_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
|
||||
#define _________________ADJUST_L3_________________ _________________MEDIA_LEFT________________
|
||||
|
||||
#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5
|
||||
#define _________________ADJUST_R1_________________ SEC1, SEC2, SEC3, SEC4, SEC5
|
||||
#define _________________ADJUST_R2_________________ _________________FUNC_RIGHT________________
|
||||
#define _________________ADJUST_R3_________________ KC_MUTE, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
|
||||
#define _________________ADJUST_R3_________________ _________________MEDIA_RIGHT_______________
|
||||
|
||||
#define _________________RGB_UP____________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
|
||||
#define _________________RGB_CENTER________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM
|
||||
#define _________________RGB_DOWN__________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T
|
||||
|
||||
/*
|
||||
#define _________________RGB_L1____________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
|
||||
#define _________________RGB_L2____________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM
|
||||
#define _________________RGB_L3____________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T
|
||||
#define _________________RGB_R1____________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG
|
||||
#define _________________RGB_R2____________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM
|
||||
#define _________________RGB_R3____________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T
|
||||
*/
|
||||
/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et
|
||||
*/
|
||||
|
||||
#define __________________GAMEPAD_L1_______________ _______, KC_Q, KC_W, KC_E, _______
|
||||
#define __________________GAMEPAD_L2_______________ _______, KC_A, KC_S, KC_D, _______
|
||||
#define __________________GAMEPAD_L3_______________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||
|
||||
#define __________________GAMEPAD_R1_______________ _______, KC_U, KC_UP, KC_O, _______
|
||||
#define __________________GAMEPAD_R2_______________ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______
|
||||
#define __________________GAMEPAD_R3_______________ KC_6, KC_7, KC_8, KC_9, KC_0
|
||||
/* vi: ft=c:tw=80:sw=2:ts=2:sts=2:et */
|
||||
|
||||
|
|
Loading…
Reference in New Issue