summaryrefslogtreecommitdiffstats
path: root/users/spidey3/spidey3.h
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2020-06-05 05:01:47 -0400
committerGitHub <noreply@github.com>2020-06-05 02:01:47 -0700
commitd03bc3a9c185f97d3813758e7f6df7c879f42ad0 (patch)
tree8b5a0b3aeede0aed5ab52061b8a129f808525526 /users/spidey3/spidey3.h
parentc12e429da28399004dddcf2c67f7cb4bca8d28e4 (diff)
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
Diffstat (limited to 'users/spidey3/spidey3.h')
-rw-r--r--users/spidey3/spidey3.h72
1 files changed, 51 insertions, 21 deletions
diff --git a/users/spidey3/spidey3.h b/users/spidey3/spidey3.h
index 224858391d..5bfba4e592 100644
--- a/users/spidey3/spidey3.h
+++ b/users/spidey3/spidey3.h
@@ -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