diff options
Diffstat (limited to 'users/spidey3')
-rw-r--r-- | users/spidey3/config.h | 14 | ||||
-rw-r--r-- | users/spidey3/layer_rgb.c | 59 | ||||
-rw-r--r-- | users/spidey3/rules.mk | 2 | ||||
-rw-r--r-- | users/spidey3/spidey3.c | 33 | ||||
-rw-r--r-- | users/spidey3/spidey3.h | 11 | ||||
-rw-r--r-- | users/spidey3/spidey3_unicode.c (renamed from users/spidey3/unicode.c) | 4 | ||||
-rw-r--r-- | users/spidey3/spidey3_unicode.h (renamed from users/spidey3/unicode.h) | 0 |
7 files changed, 56 insertions, 67 deletions
diff --git a/users/spidey3/config.h b/users/spidey3/config.h index 91bcf910ee..0b3bf8f723 100644 --- a/users/spidey3/config.h +++ b/users/spidey3/config.h @@ -14,14 +14,8 @@ # define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF # define RGBLIGHT_STARTUP_ANIMATION -# undef RGBLIGHT_ANIMATIONS -# define RGBLIGHT_EFFECT_BREATHING -# define RGBLIGHT_EFFECT_RAINBOW_MOOD -# define RGBLIGHT_EFFECT_RAINBOW_SWIRL -# define RGBLIGHT_EFFECT_SNAKE -# define RGBLIGHT_EFFECT_KNIGHT -# define RGBLIGHT_EFFECT_STATIC_GRADIENT -# define RGBLIGHT_EFFECT_TWINKLE +# undef RGBLIGHT_EFFECT_CHRISTMAS +# undef RGBLIGHT_EFFECT_ALTERNATING # define RGBLIGHT_DEFAULT_HUE 213 # define RGBLIGHT_DEFAULT_SAT UINT8_MAX @@ -37,12 +31,12 @@ #endif -#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WINC, UC_EMACS +#define UNICODE_SELECTED_MODES UNICODE_MODE_MACOS, UNICODE_MODE_LINUX, UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_EMACS #define SPI_DEBUG_SCAN_RATE #undef MANUFACTURER -#define MANUFACTURER Window of Fire +#define MANUFACTURER "Window of Fire" // Some keyboards enable BACKLIGHT_CAPS_LOCK without checking if backlight is enabled. // Undef as appropriate to avoid compiler warnings in that case. diff --git a/users/spidey3/layer_rgb.c b/users/spidey3/layer_rgb.c index c867468194..75a4b4c0a1 100644 --- a/users/spidey3/layer_rgb.c +++ b/users/spidey3/layer_rgb.c @@ -61,9 +61,9 @@ const rgblight_segment_t PROGMEM _huh_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNE #define UNICODE_OFFSET 12 const rgblight_segment_t PROGMEM _uc_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_PURPLE)); -// No indicator for UC_LNX -// UC_WIN disabled in config.h -// UC_BSD not implemented +// No indicator for UNICODE_MODE_LINUX +// UNICODE_MODE_WINDOWS disabled in config.h +// UNICODE_MODE_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)); @@ -85,19 +85,19 @@ const rgblight_segment_t *const PROGMEM _rgb_layers[] = { [ACK_OFFSET + ACK_MEH] = _meh_layer, [ACK_OFFSET + ACK_HUH] = _huh_layer, - [UNICODE_OFFSET + UC_MAC] = _uc_mac_layer, - [UNICODE_OFFSET + UC_LNX] = _none, - [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 + UNICODE_MODE_MACOS] = _uc_mac_layer, + [UNICODE_OFFSET + UNICODE_MODE_LINUX] = _none, + [UNICODE_OFFSET + UNICODE_MODE_WINDOWS] = _none, + [UNICODE_OFFSET + UNICODE_MODE_BSD] = _none, + [UNICODE_OFFSET + UNICODE_MODE_WINCOMPOSE] = _uc_winc_layer, + [UNICODE_OFFSET + UNICODE_MODE_EMACS] = _uc_emacs_layer, - [UNICODE_OFFSET + UC__COUNT] = NULL + [UNICODE_OFFSET + UNICODE_MODE_COUNT] = NULL }; // clang-format on -const uint8_t PROGMEM _n_rgb_layers = sizeof(_rgb_layers) / sizeof(_rgb_layers[0]) - 1; +const uint8_t PROGMEM _n_rgb_layers = ARRAY_SIZE(_rgb_layers) - 1; void clear_rgb_layers() { for (uint8_t i = 0; i < _n_rgb_layers; i++) { @@ -112,9 +112,8 @@ void do_rgb_layers(layer_state_t state, uint8_t start, uint8_t end) { } } -void do_rgb_unicode(void) { - uint8_t uc_mode = get_unicode_input_mode(); - for (uint8_t i = 0; i < UC__COUNT; i++) { +void do_rgb_unicode(uint8_t uc_mode) { + for (uint8_t i = 0; i < UNICODE_MODE_COUNT; i++) { bool is_on = i == uc_mode; rgblight_set_layer_state(UNICODE_OFFSET + i, is_on); } @@ -123,7 +122,7 @@ void do_rgb_unicode(void) { void do_rgb_all(void) { do_rgb_layers(default_layer_state, LAYER_BASE_DEFAULT, LAYER_BASE_REGULAR); do_rgb_layers(layer_state, LAYER_BASE_REGULAR, LAYER_BASE_END); - do_rgb_unicode(); + do_rgb_unicode(get_unicode_input_mode()); rgblight_set_layer_state(MISC_OFFSET + 0, spi_gflock); rgblight_set_layer_state(MISC_OFFSET + 1, spi_replace_mode != SPI_NORMAL); } @@ -148,7 +147,7 @@ extern rgblight_status_t rgblight_status; # define STARTUP_ANIMATION_CYCLE_STEP 2 # define STARTUP_ANIMATION_RAMP_TO_STEPS 70 # define STARTUP_ANIMATION_STEP_TIME 10 -# define STARTUP_ANIMATION_INITIAL_DELAY 0 // milliseconds, must be < 255 * STEP_TIME +# define STARTUP_ANIMATION_INITIAL_DELAY 0 // milliseconds, must be < 255 * STEP_TIME // clang-format off typedef enum { @@ -382,6 +381,13 @@ bool led_update_user_rgb(led_t led_state) { return true; } +#if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user_rgb(uint8_t input_mode) { + rgb_layer_ack(ACK_MEH); + do_rgb_unicode(input_mode); +} +#endif + void rgb_layer_ack_yn(bool yn) { rgb_layer_ack(yn ? ACK_YES : ACK_NO); } void rgb_layer_ack(layer_ack_t n) { @@ -438,7 +444,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // Acks follow... - case DEBUG: + case QK_DEBUG_TOGGLE: if (debug_matrix || debug_keyboard) rgb_layer_ack(ACK_HUH); else if (debug_enable) @@ -458,13 +464,13 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { break; case RGB_TOG: - // Hack - we only get called on the press for RGB_TOG, + // 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 - case VLK_TOG: + case QK_VELOCIKEY_TOGGLE: rgb_layer_ack_yn(velocikey_enabled()); break; #endif @@ -476,20 +482,5 @@ void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { rgb_layer_ack_yn(keymap_config.nkro); break; #endif - -#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); - do_rgb_unicode(); - break; -#endif } } diff --git a/users/spidey3/rules.mk b/users/spidey3/rules.mk index c95582e176..35cfdb4187 100644 --- a/users/spidey3/rules.mk +++ b/users/spidey3/rules.mk @@ -11,5 +11,5 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) SRC += layer_rgb.c endif ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) - SRC += unicode.c + SRC += spidey3_unicode.c endif diff --git a/users/spidey3/spidey3.c b/users/spidey3/spidey3.c index 842bb465f7..0f3c08fca6 100644 --- a/users/spidey3/spidey3.c +++ b/users/spidey3/spidey3.c @@ -98,14 +98,14 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin clear_oneshot_mods(); #endif - bool caps = host_keyboard_led_state().caps_lock; + bool caps = host_keyboard_led_state().caps_lock; uint32_t base = ((shifted == caps) ? baseAlphaLower : baseAlphaUpper); _register(base + (keycode - KC_A)); set_mods(temp_mod); } return false; case KC_0: - if (shifted) { // skip shifted numbers, so that we can still use symbols etc. + if (shifted) { // skip shifted numbers, so that we can still use symbols etc. return true; } if (record->event.pressed) { @@ -113,7 +113,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin } return false; case KC_1 ... KC_9: - if (shifted) { // skip shifted numbers, so that we can still use symbols etc. + if (shifted) { // skip shifted numbers, so that we can still use symbols etc. return true; } if (record->event.pressed) { @@ -122,7 +122,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, uin return false; case KC_SPACE: if (record->event.pressed) { - _register(spaceGlyph); // em space + _register(spaceGlyph); // em space } return false; } @@ -172,7 +172,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { #ifndef NO_DEBUG // Re-implement this here, but fix the persistence! - case DEBUG: + case QK_DEBUG_TOGGLE: if (get_mods() & MOD_MASK_SHIFT) { debug_enable = 0; debug_keyboard = 0; @@ -199,8 +199,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // clang-format off - case CH_CPNL: host_consumer_send(AL_CONTROL_PANEL); return false; - case CH_ASST: host_consumer_send(AL_ASSISTANT); return false; case CH_SUSP: tap_code16(LGUI(LSFT(KC_L))); return true; // clang-format on @@ -226,7 +224,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // to determine what Print Screen key should do. The // idea here is to make it consistent across hosts. switch (get_unicode_input_mode()) { - case UC_MAC: + case UNICODE_MODE_MACOS: if ((mods | osm) & MOD_MASK_ALT) { // Window screenshot clear_mods(); @@ -249,8 +247,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; - case UC_WIN: - case UC_WINC: + case UNICODE_MODE_WINDOWS: + case UNICODE_MODE_WINCOMPOSE: if ((mods | osm) & MOD_MASK_ALT) { // Window screenshot // Alt+PrintScreen should work as is @@ -285,11 +283,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } else { switch (keycode) { - case CH_CPNL: - case CH_ASST: - host_consumer_send(0); - return false; - case SPI_KP_00: unregister_code(KC_KP_0); return false; @@ -338,7 +331,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_mods(mods); return false; } - } else { // on release of KC_BSPC + } else { // on release of KC_BSPC // In case KC_DEL is still being sent even after the release of KC_BSPC if (delkey_registered) { unregister_code(KC_DEL); @@ -387,3 +380,11 @@ bool led_update_user(led_t led_state) { return true; #endif } + +#if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user(uint8_t input_mode) { +# ifdef RGBLIGHT_ENABLE + unicode_input_mode_set_user_rgb(input_mode); +# endif +} +#endif diff --git a/users/spidey3/spidey3.h b/users/spidey3/spidey3.h index e91b299e55..2b2cac0a20 100644 --- a/users/spidey3/spidey3.h +++ b/users/spidey3/spidey3.h @@ -6,7 +6,7 @@ #include QMK_KEYBOARD_H #ifdef UNICODEMAP_ENABLE -# include "unicode.h" +# include "spidey3_unicode.h" #endif enum userspace_layers { @@ -17,9 +17,7 @@ enum userspace_layers { }; enum custom_keycodes { - CH_CPNL = SAFE_RANGE, // AL Control Panel - CH_ASST, // AL Context-aware Desktop Assistant - CH_SUSP, // Suspend + CH_SUSP = SAFE_RANGE, // Suspend SPI_NORMAL, SPI_WIDE, @@ -65,6 +63,11 @@ void rgb_layer_ack(layer_ack_t n); void rgb_layer_ack_yn(bool yn); void clear_rgb_layers(void); void shutdown_user_rgb(void); + +# if defined(UNICODE_COMMON_ENABLE) +void unicode_input_mode_set_user_rgb(uint8_t input_mode); +# endif + #endif #ifdef UNICODEMAP_ENABLE diff --git a/users/spidey3/unicode.c b/users/spidey3/spidey3_unicode.c index 5292b0809b..bda0876b54 100644 --- a/users/spidey3/unicode.c +++ b/users/spidey3/spidey3_unicode.c @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later -#include "unicode.h" +#include "spidey3_unicode.h" const uint32_t PROGMEM unicode_map[] = { [BUL1] = 0x2022, // • @@ -24,5 +24,5 @@ const uint32_t PROGMEM unicode_map[] = { void eeconfig_init_user_unicode(void) { // Default to Linux style - set_unicode_input_mode(UC_LNX); + set_unicode_input_mode(UNICODE_MODE_LINUX); } diff --git a/users/spidey3/unicode.h b/users/spidey3/spidey3_unicode.h index ee8e00056c..ee8e00056c 100644 --- a/users/spidey3/unicode.h +++ b/users/spidey3/spidey3_unicode.h |