mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-17 17:35:30 +00:00
More spidey3 userspace cleanup (#18049)
This commit is contained in:
parent
ef0c87c976
commit
37a85e1f9b
11 changed files with 56 additions and 69 deletions
|
@ -24,7 +24,7 @@
|
|||
#undef LOCKING_SUPPORT_ENABLE
|
||||
|
||||
#define LAYER_STATE_8BIT
|
||||
#define MAX_LAYER 4
|
||||
#define MAX_LAYER 5
|
||||
|
||||
#undef RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
|
|
|
@ -61,11 +61,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
RGB_RMOD, RGB_TOG, RGB_MOD),
|
||||
|
||||
[_FN] = LAYOUT(
|
||||
KC_TRNS, DEBUG, QK_BOOT, KC_TRNS,
|
||||
KC_NO, DEBUG, QK_BOOT, KC_TRNS,
|
||||
KC_NO, KC_NO, EEP_RST, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_NO, KC_TRNS,
|
||||
KC_NO, KC_NO, KC_NO),
|
||||
KC_TRNS, KC_NO, KC_NO),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[_MACRO] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_NUMPAD] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_CURSOR] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_RGB] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI ), ENCODER_CCW_CW(RGB_SAD, RGB_SAI ), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
|
||||
[_FN] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
typedef enum layer_ack {
|
||||
|
@ -153,9 +162,22 @@ void spidey_glow(void) {
|
|||
rgblight_sethsv(255, 230, 128);
|
||||
}
|
||||
|
||||
void eeconfig_init_user(void) { spidey_glow(); }
|
||||
void eeconfig_init_user(void) {
|
||||
spidey_glow();
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
dprintf("key event: kc: %02X, col: %02u, row: %02u, pressed: %u mods: %08b "
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
"os: %08b "
|
||||
#endif
|
||||
"weak: %08b\n",
|
||||
keycode, record->event.key.col, record->event.key.row, record->event.pressed, bitrev(get_mods()),
|
||||
#if !defined(NO_ACTION_ONESHOT)
|
||||
bitrev(get_oneshot_mods()),
|
||||
#endif
|
||||
bitrev(get_weak_mods()));
|
||||
|
||||
if (record->event.pressed) {
|
||||
switch (keycode) {
|
||||
// Re-implement this here, but fix the persistence!
|
||||
|
@ -208,39 +230,3 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
}
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _RGB:
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_hue();
|
||||
} else {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
} else if (index == 1) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_sat();
|
||||
} else {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
} else if (index == 2) {
|
||||
if (clockwise) {
|
||||
rgblight_increase_val();
|
||||
} else {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (index == 0) {
|
||||
tap_code16(C(S(clockwise ? KC_EQL : KC_MINS)));
|
||||
} else if (index == 1) {
|
||||
tap_code16(C(clockwise ? KC_EQL : KC_MINS));
|
||||
} else if (index == 2) {
|
||||
tap_code(clockwise ? KC_VOLU : KC_VOLD);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
MOUSEKEY_ENABLE = no
|
||||
MIDI_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
CONSOLE_ENABLE = yes
|
||||
GRAVE_ESC_ENABLE = no
|
||||
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
|
|
@ -24,10 +24,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
),
|
||||
// FN
|
||||
[_FN] = LAYOUT_65_ansi_blocker(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_SLCK,
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_SLCK,
|
||||
XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, SPI_GLO, VLK_TOG, CH_SUSP, KC_SLEP, KC_PWR, KC_BRIU,
|
||||
MO(_GLYPH), RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_TW, SPI_LNX, XXXXXXX, XXXXXXX, CH_CPNL, KC_BRID,
|
||||
_______, XXXXXXX, XXXXXXX, SPI_WIN, UC_MOD, NK_TOGG, TG(_NUMPAD),SPI_OSX, XXXXXXX, XXXXXXX, DEBUG, _______, KC_VOLU, KC_MUTE,
|
||||
MO(_GLYPH), RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_TW, UC_M_LN, XXXXXXX, XXXXXXX, CH_CPNL, KC_BRID,
|
||||
_______, XXXXXXX, UC_M_EM, UC_M_WC, UC_MOD, NK_TOGG, TG(_NUMPAD),UC_M_MA, XXXXXXX, XXXXXXX, DEBUG, _______, KC_VOLU, KC_MUTE,
|
||||
_______, _______, _______, KC_MPLY, CH_ASST, _______, KC_MPRV, KC_VOLD, KC_MNXT
|
||||
),
|
||||
// Glyph Transformation
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
#define NO_ACTION_ONESHOT
|
||||
#undef LOCKING_SUPPORT_ENABLE
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
QK_BOOT, SPI_NORMAL, SPI_WIDE, SPI_SCRIPT, SPI_BLOCKS, SPI_CIRCLE, SPI_SQUARE, SPI_PARENS, SPI_FRAKTR, SPI_BOLD, SPI_MATH, XXXXXXX, SPI_GFLOCK, KC_SLEP, CH_SUSP, KC_PWR,
|
||||
EEP_RST, X(SAD), X(MEH), X(HAPPY), X(ANGRY), X(THUMBDN), X(THUMBUP), X(SPIDER), X_BUL, X(LOL), X(SURPRISE),X_DASH, XXXXXXX, KC_PAUS, KC_SLCK,
|
||||
XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, SPI_GLO, VLK_TOG, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRIU,
|
||||
XXXXXXX, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_TW, SPI_LNX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID,
|
||||
_______, XXXXXXX, XXXXXXX, SPI_WIN, UC_MOD, NK_TOGG, TG(_NUMPAD),SPI_OSX, X(LARR), X(RARR), DEBUG, _______, KC_VOLU, KC_MUTE,
|
||||
XXXXXXX, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_TW, UC_M_LN, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID,
|
||||
_______, XXXXXXX, UC_M_EM, UC_M_WC, UC_MOD, NK_TOGG, TG(_NUMPAD),UC_M_MA, X(LARR), X(RARR), DEBUG, _______, KC_VOLU, KC_MUTE,
|
||||
_______, _______, _______, KC_MPLY, CH_ASST, _______, CH_CPNL, KC_MPRV, KC_VOLD, KC_MNXT
|
||||
)
|
||||
};
|
||||
|
|
|
@ -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…
Reference in a new issue