More spidey3 userspace cleanup (#18049)
This commit is contained in:
parent
ef0c87c976
commit
37a85e1f9b
11 changed files with 56 additions and 69 deletions
|
@ -9,7 +9,7 @@
|
|||
#ifdef RGBLIGHT_ENABLE
|
||||
|
||||
# define RGBLIGHT_LAYERS
|
||||
# define RGBLIGHT_MAX_LAYERS 17
|
||||
# define RGBLIGHT_MAX_LAYERS 18
|
||||
# define RGBLIGHT_LAYER_BLINK
|
||||
# define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||
# define RGBLIGHT_STARTUP_ANIMATION
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#endif
|
||||
|
||||
#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WINC
|
||||
#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WINC, UC_EMACS
|
||||
|
||||
#define SPI_DEBUG_SCAN_RATE
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ const rgblight_segment_t PROGMEM _uc_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORN
|
|||
// UC_WIN disabled in config.h
|
||||
// UC_BSD not implemented
|
||||
const rgblight_segment_t PROGMEM _uc_winc_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_CYAN));
|
||||
const rgblight_segment_t PROGMEM _uc_emacs_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_GREEN));
|
||||
|
||||
// Now define the array of layers. Higher numbered layers take precedence.
|
||||
const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
|
||||
|
@ -89,6 +90,7 @@ const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
|
|||
[UNICODE_OFFSET + UC_WIN] = _none,
|
||||
[UNICODE_OFFSET + UC_BSD] = _none,
|
||||
[UNICODE_OFFSET + UC_WINC] = _uc_winc_layer,
|
||||
[UNICODE_OFFSET + UC_EMACS] = _uc_emacs_layer,
|
||||
|
||||
[UNICODE_OFFSET + UC__COUNT] = NULL
|
||||
};
|
||||
|
@ -300,8 +302,8 @@ void matrix_scan_user_rgb(void) {
|
|||
# ifdef STARTUP_ANIMATION_DEBUG
|
||||
dprintf("sua RAMP_DOWN counter=%u\n", counter);
|
||||
# endif
|
||||
rgblight_sethsv_noeeprom(old_config.hue, STARTUP_ANIMATION_SATURATION, counter);
|
||||
if (counter >= STARTUP_ANIMATION_FADE_STEP) {
|
||||
rgblight_sethsv_noeeprom(old_config.hue, STARTUP_ANIMATION_SATURATION, counter);
|
||||
counter -= STARTUP_ANIMATION_FADE_STEP;
|
||||
} else {
|
||||
startup_animation_state = CLEAN_UP;
|
||||
|
@ -456,7 +458,9 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
|||
break;
|
||||
|
||||
case RGB_TOG:
|
||||
rgb_layer_ack_yn(rgblight_config.enable);
|
||||
// Hack - we only get called on the press for RGB_TOG,
|
||||
// but the flag is only flipped on the release...
|
||||
rgb_layer_ack_yn(!rgblight_config.enable);
|
||||
break;
|
||||
|
||||
#ifdef VELOCIKEY_ENABLE
|
||||
|
@ -473,10 +477,14 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
|||
break;
|
||||
#endif
|
||||
|
||||
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
|
||||
case SPI_LNX:
|
||||
case SPI_OSX:
|
||||
case SPI_WIN:
|
||||
#if defined(UNICODE_COMMON_ENABLE)
|
||||
case UC_M_MA:
|
||||
case UC_M_LN:
|
||||
case UC_M_WI:
|
||||
case UC_M_BS:
|
||||
case UC_M_WC:
|
||||
case UC_M_EM:
|
||||
|
||||
case UC_MOD:
|
||||
case UC_RMOD:
|
||||
rgb_layer_ack(ACK_MEH);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
NKRO_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
|
||||
SRC += init.c
|
||||
|
|
|
@ -55,7 +55,8 @@ void matrix_scan_user(void) {
|
|||
}
|
||||
|
||||
static uint32_t math_glyph_exceptions(const uint16_t keycode, const bool shifted) {
|
||||
if (shifted) {
|
||||
bool caps = host_keyboard_led_state().caps_lock;
|
||||
if (shifted != caps) {
|
||||
switch (keycode) {
|
||||
// clang-format off
|
||||
case KC_C: return 0x2102;
|
||||
|
@ -97,7 +98,8 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin
|
|||
clear_oneshot_mods();
|
||||
#endif
|
||||
|
||||
uint32_t base = shifted ? baseAlphaUpper : baseAlphaLower;
|
||||
bool caps = host_keyboard_led_state().caps_lock;
|
||||
uint32_t base = ((shifted == caps) ? baseAlphaLower : baseAlphaUpper);
|
||||
_register(base + (keycode - KC_A));
|
||||
set_mods(temp_mod);
|
||||
}
|
||||
|
@ -201,11 +203,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
case CH_ASST: host_consumer_send(AL_ASSISTANT); return false;
|
||||
case CH_SUSP: tap_code16(LGUI(LSFT(KC_L))); return true;
|
||||
|
||||
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
|
||||
case SPI_LNX: set_unicode_input_mode(UC_LNX); break;
|
||||
case SPI_OSX: set_unicode_input_mode(UC_OSX); break;
|
||||
case SPI_WIN: set_unicode_input_mode(UC_WINC); break;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
case SPI_NORMAL ... SPI_MATH:
|
||||
|
|
|
@ -17,10 +17,7 @@ enum userspace_layers {
|
|||
};
|
||||
|
||||
enum custom_keycodes {
|
||||
SPI_LNX = SAFE_RANGE, // Mode: Linux
|
||||
SPI_OSX, // Mode: Mac
|
||||
SPI_WIN, // Mode: Windows
|
||||
CH_CPNL, // AL Control Panel
|
||||
CH_CPNL = SAFE_RANGE, // AL Control Panel
|
||||
CH_ASST, // AL Context-aware Desktop Assistant
|
||||
CH_SUSP, // Suspend
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue