Compare commits

...

2 Commits

Author SHA1 Message Date
James Young
dd8b4dce55
Atreyu: correct layout data (#21197) 2023-06-10 16:33:33 -07:00
Allen Choi
57b23b8d96
[Keymap] thunderbird2086 layer status with RGB lighting/matrix (#21063) 2023-06-10 14:35:15 -06:00
10 changed files with 178 additions and 71 deletions

View File

@ -81,21 +81,21 @@
{"matrix": [3, 4], "x": 4, "y": 3.125},
{"matrix": [3, 5], "x": 5, "y": 3.25},
{"matrix": [7, 5], "x": 6, "y": 2.75},
{"matrix": [7, 4], "x": 9.5, "y": 2.75},
{"matrix": [7, 3], "x": 10.5, "y": 3.25},
{"matrix": [7, 2], "x": 11.5, "y": 3.125},
{"matrix": [7, 1], "x": 12.5, "y": 3},
{"matrix": [7, 0], "x": 13.5, "y": 3.125},
{"matrix": [7, 5], "x": 10.5, "y": 3.25},
{"matrix": [7, 4], "x": 11.5, "y": 3.125},
{"matrix": [7, 3], "x": 12.5, "y": 3},
{"matrix": [7, 2], "x": 13.5, "y": 3.125},
{"matrix": [7, 1], "x": 14.5, "y": 3.375},
{"matrix": [7, 0], "x": 15.5, "y": 3.5},
{"matrix": [8, 0], "x": 14.5, "y": 3.375},
{"matrix": [8, 1], "x": 15.5, "y": 3.5},
{"matrix": [8, 2], "x": 0, "y": 4.5},
{"matrix": [8, 3], "x": 2.5, "y": 4.125},
{"matrix": [8, 4], "x": 3.5, "y": 4.15},
{"matrix": [8, 5], "x": 4.5, "y": 4.25},
{"matrix": [8, 0], "x": 0, "y": 4.5},
{"matrix": [8, 1], "x": 2.5, "y": 4.125},
{"matrix": [8, 2], "x": 3.5, "y": 4.15},
{"matrix": [8, 3], "x": 4.5, "y": 4.25},
{"matrix": [8, 4], "x": 6, "y": 4.25, "h": 1.25},
{"matrix": [8, 5], "x": 6, "y": 2.75},
{"matrix": [9, 5], "x": 6, "y": 4.25, "h": 1.25},
{"matrix": [9, 5], "x": 9.5, "y": 2.75},
{"matrix": [9, 4], "x": 9.5, "y": 4.25, "h": 1.25},
{"matrix": [9, 3], "x": 11, "y": 4.25},
{"matrix": [9, 2], "x": 12, "y": 4.15},

View File

@ -73,26 +73,26 @@
{"matrix": [3, 4], "x": 4, "y": 3.125},
{"matrix": [3, 5], "x": 5, "y": 3.25},
{"matrix": [7, 5], "x": 6, "y": 2.75},
{"matrix": [7, 4], "x": 9.5, "y": 2.75},
{"matrix": [7, 3], "x": 10.5, "y": 3.25},
{"matrix": [7, 2], "x": 11.5, "y": 3.125},
{"matrix": [7, 1], "x": 12.5, "y": 3},
{"matrix": [7, 0], "x": 13.5, "y": 3.125},
{"matrix": [7, 5], "x": 10.5, "y": 3.25},
{"matrix": [7, 4], "x": 11.5, "y": 3.125},
{"matrix": [7, 3], "x": 12.5, "y": 3},
{"matrix": [7, 2], "x": 13.5, "y": 3.125},
{"matrix": [7, 1], "x": 14.5, "y": 3.375},
{"matrix": [7, 0], "x": 15.5, "y": 3.5},
{"matrix": [8, 0], "x": 14.5, "y": 3.375},
{"matrix": [8, 1], "x": 15.5, "y": 3.5},
{"matrix": [8, 2], "x": 0, "y": 4.5},
{"matrix": [8, 3], "x": 2.5, "y": 4.125},
{"matrix": [8, 4], "x": 3.5, "y": 4.15},
{"matrix": [8, 5], "x": 4.5, "y": 4.25},
{"matrix": [8, 0], "x": 0, "y": 4.5},
{"matrix": [8, 1], "x": 2.5, "y": 4.125},
{"matrix": [8, 2], "x": 3.5, "y": 4.15},
{"matrix": [8, 3], "x": 4.5, "y": 4.25},
{"matrix": [8, 4], "x": 6, "y": 4.25, "h": 1.25},
{"matrix": [8, 5], "x": 6, "y": 2.75},
{"matrix": [9, 5], "x": 6, "y": 4.25, "h": 1.25},
{"matrix": [9, 5], "x": 9.5, "y": 2.75},
{"matrix": [9, 4], "x": 9.5, "y": 4.25, "h": 1.25},
{"matrix": [9, 3], "x": 11, "y": 4.25},
{"matrix": [9, 2], "x": 12, "y": 4.15},
{"matrix": [9, 1], "x": 13, "y": 4.125},
{"matrix": [9, 0], "x": 14.5, "y": 4.5}
{"matrix": [9, 0], "x": 15.5, "y": 4.5}
]
}
}

View File

@ -14,6 +14,7 @@
# undef TAPPING_TERM
#endif
#define TAPPING_TERM 200
#define VER_NEWLINE_WAIT 200 // in milliseconds
#define NO_ACTION_ONESHOT
@ -32,63 +33,80 @@
#define RGBLIGHT_SLEEP
#if defined(RGBLIGHT_ENABLE)
# define RGBLIGHT_LAYERS
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_HUE_STEP 16
# define RGBLIGHT_SAT_STEP 32
# define RGBLIGHT_VAL_STEP 32
# define RGBLIGHT_EFFECT_ALTERING
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_TWINKLE
#endif
#if defined(RGB_MATRIX_ENABLE)
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
# define SPLIT_LAYER_STATE_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
// limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
# define RGB_MATRIX_HUE_STEP 32
# define RGB_MATRIX_SAT_STEP 64
# define RGB_MATRIX_VAL_STEP 64
# define RGB_MATRIX_SPD_STEP 20
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR
# define RGB_MATRIX_HUE_STEP 32
# define RGB_MATRIX_SAT_STEP 64
# define RGB_MATRIX_VAL_STEP 64
# define RGB_MATRIX_SPD_STEP 20
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR
/* Disable the animations you don't want/need. You will need to disable a good number of these *
* because they take up a lot of space. Disable until you can successfully compile your firmware. */
# undef ENABLE_RGB_MATRIX_ALPHAS_MODS
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
# undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define ENABLE_RGB_MATRIX_BREATHING
# undef ENABLE_RGB_MATRIX_BREATHING
# undef ENABLE_RGB_MATRIX_BAND_SAT
# undef ENABLE_RGB_MATRIX_BAND_VAL
# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
# undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
# undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
# define ENABLE_RGB_MATRIX_CYCLE_ALL
# undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# undef ENABLE_RGB_MATRIX_CYCLE_ALL
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
# undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN
# undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# undef ENABLE_RGB_MATRIX_DUAL_BEACON
# undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
# undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL
# undef ENABLE_RGB_MATRIX_RAINBOW_BEACON
# undef ENABLE_RGB_MATRIX_DUAL_BEACON
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
# undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
# undef ENABLE_RGB_MATRIX_RAINDROPS
# undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# undef ENABLE_RGB_MATRIX_HUE_BREATHING
# undef ENABLE_RGB_MATRIX_HUE_PENDULUM
# undef ENABLE_RGB_MATRIX_HUE_WAVE
# undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL
# define ENABLE_RGB_MATRIX_PIXEL_FLOW
# undef ENABLE_RGB_MATRIX_PIXEL_RAIN
# undef ENABLE_RGB_MATRIX_TYPING_HEATMAP
# undef ENABLE_RGB_MATRIX_DIGITAL_RAIN
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define ENABLE_RGB_MATRIX_SPLASH
# undef ENABLE_RGB_MATRIX_MULTISPLASH
# undef ENABLE_RGB_MATRIX_SOLID_SPLASH
# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
# undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# undef ENABLE_RGB_MATRIX_SPLASH
# define ENABLE_RGB_MATRIX_MULTISPLASH
# undef ENABLE_RGB_MATRIX_SOLID_SPLASH
# undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif

View File

@ -5,12 +5,15 @@
enum custom_keycodes {
// Layer Macros
COLEMAK = SAFE_RANGE,
COLEMAK = QK_USER,
QWERTY,
FUNCTION,
CODE,
ADJUST,
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
RGBRST,
# endif
VRSN,
// Secret Macros
M_XXX1,
M_XXX2,

View File

@ -80,6 +80,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
// clang-format off
#if defined(RGBLIGHT_ENABLE)
__attribute__((weak))
void set_rgb_by_layer(layer_state_t state) {
return;
}
#endif
layer_state_t layer_state_set_user(layer_state_t state) {
# if defined(RGBLIGHT_ENABLE)
set_rgb_by_layer(state);
# endif
return update_tri_layer_state(state, _FUNCTION, _ADJUST, _SECRET);
}

View File

@ -48,10 +48,10 @@
#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
# define ________________________ADJUST_L2________________________ RGBRST , XXXXXXX , RGB_SPI , RGB_SAI , RGB_HUI , RGB_VAI
# define ________________________ADJUST_L3________________________ EE_CLR , XXXXXXX , RGB_SPD , RGB_SAD , RGB_HUD , RGB_VAD
# define ________________________ADJUST_L3________________________ EE_CLR , VRSN , RGB_SPD , RGB_SAD , RGB_HUD , RGB_VAD
#else
# define ________________________ADJUST_L2________________________ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
# define ________________________ADJUST_L3________________________ EE_CLR , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
# define ________________________ADJUST_L3________________________ EE_CLR , VRSN , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
#endif
#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)

View File

@ -4,6 +4,7 @@
#include QMK_KEYBOARD_H
#include "keycodes.h"
#include "version.h"
__attribute__((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
@ -23,18 +24,31 @@ bool process_record_oled(uint16_t keycode, keyrecord_t *record) {
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
if (record->event.pressed) {
switch (keycode) {
case COLEMAK:
set_single_persistent_default_layer(_COLEMAK);
break;
case QWERTY:
set_single_persistent_default_layer(_QWERTY);
break;
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
case RGBRST:
# if defined(RGBLIGHT_ENABLE)
eeconfig_update_rgblight_default();
rgblight_enable();
# else
eeconfig_update_rgb_matrix_default();
# endif
break;
# endif
case VRSN:
send_string(
"# qmk " QMK_VERSION "\n" SS_DELAY(VER_NEWLINE_WAIT)
"# " QMK_KEYBOARD "/" QMK_KEYMAP "\n" SS_DELAY(VER_NEWLINE_WAIT)
"# built on: " QMK_BUILDDATE "\n");
break;
}
break;
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
break;
}
return process_record_keymap(keycode, record) && process_record_secrets(keycode, record)

View File

@ -54,7 +54,7 @@ The concept is Mac and **baby finger** friendly keymap.
| --- | --- | --- |
| ESC | Caps lock | |
- ADJUST: RGB control, Power control, default layer setting and reset
- ADJUST: RGB control, Power control, default layer setting, QMK version and reset
![adjust](https://i.imgur.com/uDIhigd.png)
- SECRET: hold `ADJUST` and `FUNCTION` to activate

View File

@ -0,0 +1,61 @@
// Copyright 2023 Allen Choi (@thunderbird2086)
// SPDX-License-Identifier: GPL-2.0-or-later
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
# include QMK_KEYBOARD_H
# include "keycodes.h"
# ifdef RGBLIGHT_ENABLE
const rgblight_segment_t PROGMEM _rgb_layer_0[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 56, HSV_BLUE}
);
const rgblight_segment_t PROGMEM _rgb_layer_1[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 56, HSV_GREEN}
);
const rgblight_segment_t PROGMEM _rgb_layer_2[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 56, HSV_YELLOW}
);
const rgblight_segment_t* const PROGMEM _rgb_layers[] = RGBLIGHT_LAYERS_LIST(
_rgb_layer_0,
_rgb_layer_1,
_rgb_layer_2
);
void keyboard_post_init_user(void) {
// Enable the LED layers
rgblight_layers = _rgb_layers;
}
void set_rgb_by_layer(layer_state_t state) {
rgblight_set_layer_state(0, layer_state_cmp(state, _CODE));
rgblight_set_layer_state(1, layer_state_cmp(state, _FUNCTION));
rgblight_set_layer_state(2, layer_state_cmp(state, _ADJUST));
}
# else
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
for (uint8_t i = led_min; i < led_max; i++) {
switch(get_highest_layer(layer_state|default_layer_state)) {
case _CODE:
rgb_matrix_set_color(i, RGB_BLUE);
break;
case _FUNCTION:
rgb_matrix_set_color(i, RGB_GREEN);
break;
case _ADJUST:
rgb_matrix_set_color(i, RGB_YELLOW);
// RGB_WHITE caused crash
break;
default:
break;
}
}
return false;
}
# endif
#endif

View File

@ -11,6 +11,7 @@ TAP_DANCE_ENABLE = yes
SRC += oled.c
SRC += process_records.c
SRC += rgb.c
SRC += tap_dances.c
ifneq ("$(wildcard keyboards/crkbd/keymaps/thunderbird2086/secrets.c)","")