Major enhancements to spidey3 keymaps and userspace (#9261)

* Add Chrome OS specific keys to 75_ansi/spidey3

* Clean up duplicative settings in rules.mk

* Refactor spidey3 userspace to use rgb layer blink

* Blink green on wakeup

* Improve _FN layer indicator

* Glyph transformation modes: wide, script, fraktur, and enclosed characters

* Add spider unicode glyph

* Fix compile error when NO_ACTION_ONESHOT

* Add a few more emoji

* Further refinement of lighting layer usage

* Fix reversed yes/no ack

* Lighting layers override RGB off

* Fix missing wide and incorrect script numbers

* Add LOL and surprise emoji

* Add missing break in switch statement

* Trim firmware size

* Use usage ID definitions in report.h

* Some minor whitespace cleanup

* Disable some unused features to reduce firmware size

* Print version on startup

* Seed rand() on first keystroke

* Add a key to immediately sleep CrOS

* Switch to Bootmagic Lite

* Trim down firmware size a little bit more

* Make RGBLIGHT_MODE_TWINKLE+4 my default

* Scan rate debug / fix version printing

Delay printing version on startup (console may not be ready)
Better scan rate reporting

* Disable locking caps, etc. to save more space

* Enable LTO

* Better seed for rand()

* Set MAX_LAYER for some performance improvement

* Another scan rate improvement

* Set manufacturer

* New startup animation

* Add GUI lock for F-keys (for CrOS)

* Add visual indication for glyph replacement and F-keys GUI lock

* Some cleanup; run cformat on spidey3 userspace

* Cycle between debug verbosity options

* Fix disable RGB Lighting after wakeup on Mac
This commit is contained in:
Joshua Diamond
2020-06-05 05:01:47 -04:00
committed by GitHub
parent c12e429da2
commit d03bc3a9c1
11 changed files with 588 additions and 183 deletions

View File

@ -0,0 +1,9 @@
#pragma once
#define NO_ACTION_ONESHOT
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
#undef LOCKING_SUPPORT_ENABLE
#define LAYER_STATE_8BIT
#define MAX_LAYER 4

View File

@ -1,6 +1,5 @@
#include "spidey3.h"
#define CH_MENU A(S(KC_S))
#define OSX_PSC G(S(KC_4))
#define FN_MENU LT(_FN,KC_APP)
@ -34,11 +33,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
// FN
[_FN] = LAYOUT_75_ansi(
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLEP, KC_WAKE, KC_PWR,
EEP_RST, _______, _______, _______, _______, _______, _______, _______, X_BUL, KC_MPRV, KC_MNXT, X_DASH, _______, KC_PAUS, KC_SLCK,
RESET, SPI_NORMAL, SPI_WIDE, SPI_SCRIPT, SPI_BLOCKS, SPI_CIRCLE, SPI_SQUARE, SPI_PARENS, SPI_FRAKTR, _______, _______, _______, SPI_GFLOCK, KC_SLEP, KC_WAKE, 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, _______, KC_PAUS, KC_SLCK,
_______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, RGB_SPD, RGB_SPI, VLK_TOG, _______, _______, KC_BRIU,
_______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_G, RGB_M_T, SPI_LNX, _______, _______, _______, KC_BRID,
_______, SPI_GLO, _______, SPI_WIN, _______, NK_TOGG, TG(_NUMPAD),SPI_OSX, X(LARR), X(RARR), DEBUG, _______, KC_VOLU, KC_MUTE,
_______, _______, _______, KC_MPLY, KC_APP, _______, CH_MENU, KC_MPRV, KC_VOLD, KC_MNXT
_______, SPI_GLO, CH_SUSP, SPI_WIN, _______, NK_TOGG, TG(_NUMPAD),SPI_OSX, X(LARR), X(RARR), DEBUG, _______, KC_VOLU, KC_MUTE,
_______, _______, _______, KC_MPLY, CH_ASST, _______, CH_CPNL, KC_MPRV, KC_VOLD, KC_MNXT
)
};

View File

@ -1,18 +1,12 @@
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes
UNICODEMAP_ENABLE = yes
VELOCIKEY_ENABLE = yes
GRAVE_ESC_ENABLE = no
# The following disabled to save space
SPACE_CADET_ENABLE = no

View File

@ -3,3 +3,21 @@
#define LED_DISABLE_WHEN_USB_SUSPENDED true
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#define RGBLIGHT_LAYERS
#define RGBLIGHT_MAX_LAYERS 16
#define RGBLIGHT_LAYER_BLINK
#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
#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_ALTERNATING
#define RGBLIGHT_EFFECT_TWINKLE
#define SPI_DEBUG_SCAN_RATE
#undef MANUFACTURER
#define MANUFACTURER Window of Fire

View File

@ -1,30 +1,28 @@
#include "spidey3.h"
void keyboard_post_init_user(void) {
print("keyboard_post_init_user\n");
uprintf("\tdebug_enable=%u\n", debug_enable);
#ifdef RGBLIGHT_ENABLE
keyboard_post_init_user_rgb();
keyboard_post_init_user_rgb();
#endif
}
void eeconfig_init_user(void) {
print("eeconfig_init_user\n");
set_single_persistent_default_layer(_BASE);
print("eeconfig_init_user\n");
set_single_persistent_default_layer(_BASE);
#ifdef UNICODEMAP_ENABLE
eeconfig_init_user_unicode();
eeconfig_init_user_unicode();
#endif
#ifdef RGBLIGHT_ENABLE
eeconfig_init_user_rgb();
eeconfig_init_user_rgb();
#endif
}
void shutdown_user() {
#ifdef RGBLIGHT_ENABLE
clear_rgb_layers();
rgblight_enable();
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom(HSV_RED);
clear_rgb_layers();
rgblight_enable();
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom(HSV_RED);
#endif
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
BOOTMAGIC_ENABLE = lite
LTO_ENABLE = yes
SRC += init.c
SRC += spidey3.c

File diff suppressed because it is too large Load Diff

View File

@ -3,41 +3,71 @@
#include QMK_KEYBOARD_H
#ifdef UNICODEMAP_ENABLE
#include "unicode.h"
# include "unicode.h"
#endif
enum userspace_layers {
_BASE = 0,
_OSX,
_NUMPAD,
_FN,
};
enum rgb_base_layer {
RGB_LAYER_BASE_DEFAULT = _BASE,
RGB_LAYER_BASE_REGULAR = _NUMPAD,
RGB_LAYER_BASE_ACKS = _FN+1,
_BASE = 0,
_OSX,
_NUMPAD,
_FN,
};
enum custom_keycodes {
SPI_GLO = SAFE_RANGE,
SPI_LNX,
SPI_OSX,
SPI_WIN,
SPI_GLO = SAFE_RANGE,
SPI_LNX, // Mode: Linux
SPI_OSX, // Mode: Mac
SPI_WIN, // Mode: Windows
CH_CPNL, // AL Control Panel
CH_ASST, // AL Context-aware Desktop Assistant
CH_SUSP, // Suspend
SPI_NORMAL,
SPI_WIDE,
SPI_SCRIPT,
SPI_BLOCKS,
SPI_CIRCLE,
SPI_SQUARE,
SPI_PARENS,
SPI_FRAKTR,
SPI_GFLOCK,
};
#ifdef RGBLIGHT_ENABLE
void eeconfig_init_user_rgb(void);
void matrix_init_user_rgb(void);
void keyboard_post_init_user_rgb(void);
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
enum layer_base {
LAYER_BASE_DEFAULT = _BASE,
LAYER_BASE_REGULAR = _NUMPAD,
LAYER_BASE_END = _FN + 1,
};
typedef enum layer_ack {
ACK_NO = 0,
ACK_YES,
ACK_MEH,
} layer_ack_t;
# define RGB_LAYER_ACK_DURATION 500
void eeconfig_init_user_rgb(void);
void matrix_init_user_rgb(void);
void keyboard_post_init_user_rgb(void);
bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
void post_process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
layer_state_t layer_state_set_user_rgb(layer_state_t state);
layer_state_t default_layer_state_set_user_rgb(layer_state_t state);
bool led_update_user_rgb(led_t led_state);
void clear_rgb_layers(void);
bool led_update_user_rgb(led_t led_state);
void rgb_layer_ack(layer_ack_t n);
void rgb_layer_ack_yn(bool yn);
void clear_rgb_layers(void);
#endif
#ifdef UNICODEMAP_ENABLE
void eeconfig_init_user_unicode(void);
#endif
#ifdef SPI_DEBUG_SCAN_RATE
# ifndef SPI_SCAN_RATE_INTERVAL
# define SPI_SCAN_RATE_INTERVAL 10
# endif
#endif

View File

@ -2,18 +2,24 @@
#include "unicode.h"
const uint32_t PROGMEM unicode_map[] = {
[BUL1] = 0x2022, // •
[BUL2] = 0x25E6, // ◦
[LARR] = 0x2190, // ←
[RARR] = 0x2192, // →
[ENDASH] = 0x2013, //
[EMDASH] = 0x2014, // —
[BUL1] = 0x2022, // •
[BUL2] = 0x25E6, // ◦
[LARR] = 0x2190, // ←
[RARR] = 0x2192, // →
[ENDASH] = 0x2013, //
[EMDASH] = 0x2014, // —
[SPIDER] = 0x1F577, // 🕷
[SAD] = 0x2639, // ☹
[MEH] = 0x1F611, // 😑
[HAPPY] = 0x1F600, // 😀
[ANGRY] = 0x1F620, // 😠
[THUMBUP] = 0x1F44D, // 👍
[THUMBDN] = 0x1F44E, // 👎
[LOL] = 0x1F602, // 😂
[SURPRISE] = 0x1F62E, // 😮
};
void eeconfig_init_user_unicode(void)
{
// Default to Linux style
set_unicode_input_mode(UC_LNX);
void eeconfig_init_user_unicode(void) {
// Default to Linux style
set_unicode_input_mode(UC_LNX);
}

View File

@ -11,9 +11,18 @@ enum unicode_names {
RARR,
ENDASH,
EMDASH,
SPIDER,
SAD,
MEH,
HAPPY,
ANGRY,
THUMBUP,
THUMBDN,
LOL,
SURPRISE,
};
#define X_BUL (XP(BUL1, BUL2))
#define X_DASH (XP(ENDASH, EMDASH))
# define X_BUL (XP(BUL1, BUL2))
# define X_DASH (XP(ENDASH, EMDASH))
#endif