consolidate more code, left top column resets
This commit is contained in:
parent
ac3678c456
commit
fa000203cc
|
@ -46,4 +46,12 @@
|
|||
// delay hold/release to not mess up software
|
||||
#define TAP_CODE_DELAY 10
|
||||
|
||||
//
|
||||
// underglow configuration
|
||||
//
|
||||
|
||||
// no lights if we sleep
|
||||
#define RGBLIGHT_SLEEP
|
||||
|
||||
// the modes we do use for lights
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
|
|
|
@ -27,7 +27,7 @@ enum my_layers {
|
|||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_BASE] = LAYOUT(
|
||||
TO(_BASE), KC_V, KC_L, KC_H, KC_K, KC_Q, KC_J, KC_F, KC_O, KC_U, KC_COMM, KC_PSCR,
|
||||
QK_RBT, KC_V, KC_L, KC_H, KC_K, KC_Q, KC_J, KC_F, KC_O, KC_U, KC_COMM, KC_PSCR,
|
||||
XXXXXXX, RALT_T(KC_S), LALT_T(KC_R), LCTL_T(KC_N), LSFT_T(KC_T), KC_W, KC_Y, RSFT_T(KC_C), RCTL_T(KC_A), LALT_T(KC_E), RALT_T(KC_I), XXXXXXX,
|
||||
XXXXXXX, KC_Z, KC_X, KC_M, LGUI_T(KC_D), KC_B, KC_P, RGUI_T(KC_G), KC_QUOT, KC_SCLN, KC_DOT, XXXXXXX,
|
||||
MO(_SYM), KC_SPC, MO(_NUM), MO(_NAV), KC_BSPC, MO(_FN)
|
||||
|
@ -83,3 +83,42 @@ bool achordion_chord(uint16_t tap_hold_keycode,
|
|||
on_left_hand(other_record->event.key);
|
||||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// always use the same effect
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
|
||||
rgblight_set_speed_noeeprom(2);
|
||||
|
||||
// trigger init of layer state
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
// handle layer changes for backlight
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
const uint8_t layer = get_highest_layer(state);
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
rgblight_sethsv_noeeprom(HSV_WHITE);
|
||||
break;
|
||||
|
||||
case _SYM:
|
||||
rgblight_sethsv_noeeprom(HSV_RED);
|
||||
break;
|
||||
|
||||
case _NUM:
|
||||
rgblight_sethsv_noeeprom(HSV_GREEN);
|
||||
break;
|
||||
|
||||
case _FN:
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
break;
|
||||
|
||||
case _NAV:
|
||||
rgblight_sethsv_noeeprom(HSV_GOLD);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -21,22 +21,3 @@
|
|||
|
||||
// select hand configuration
|
||||
#define SPLIT_USB_DETECT
|
||||
|
||||
//
|
||||
// underglow configuration
|
||||
//
|
||||
|
||||
// no lights if we sleep
|
||||
#define RGBLIGHT_SLEEP
|
||||
|
||||
// more modes for lights
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#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_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
|
|
|
@ -39,43 +39,3 @@ K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35
|
|||
|
||||
// our shared 42 keys keymap
|
||||
#include "../common/keymap.h"
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// always use the same effect
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
|
||||
rgblight_set_speed_noeeprom(2);
|
||||
|
||||
// trigger init of layer state
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
// handle layer changes for backlight
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
const uint8_t layer = get_highest_layer(state);
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
rgblight_sethsv_noeeprom(HSV_WHITE);
|
||||
break;
|
||||
|
||||
case _SYM:
|
||||
rgblight_sethsv_noeeprom(HSV_RED);
|
||||
break;
|
||||
|
||||
case _NUM:
|
||||
rgblight_sethsv_noeeprom(HSV_GREEN);
|
||||
break;
|
||||
|
||||
case _FN:
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
break;
|
||||
|
||||
case _NAV:
|
||||
rgblight_sethsv_noeeprom(HSV_GOLD);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -28,22 +28,3 @@
|
|||
|
||||
// normal startup sound
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
|
||||
//
|
||||
// underglow configuration
|
||||
//
|
||||
|
||||
// no lights if we sleep
|
||||
#define RGBLIGHT_SLEEP
|
||||
|
||||
// more modes for lights
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#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_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
|
|
|
@ -39,43 +39,3 @@ KC_NO, KC_NO, KC_NO, K36, K37, K38, K39, K40, K41, KC_NO, KC_NO, KC_
|
|||
|
||||
// our shared 42 keys keymap
|
||||
#include "../common/keymap.h"
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// always use the same effect
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
|
||||
rgblight_set_speed_noeeprom(2);
|
||||
|
||||
// trigger init of layer state
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
|
||||
// handle layer changes for backlight
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
const uint8_t layer = get_highest_layer(state);
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
rgblight_sethsv_noeeprom(HSV_WHITE);
|
||||
break;
|
||||
|
||||
case _SYM:
|
||||
rgblight_sethsv_noeeprom(HSV_RED);
|
||||
break;
|
||||
|
||||
case _NUM:
|
||||
rgblight_sethsv_noeeprom(HSV_GREEN);
|
||||
break;
|
||||
|
||||
case _FN:
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
break;
|
||||
|
||||
case _NAV:
|
||||
rgblight_sethsv_noeeprom(HSV_GOLD);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue