|
|
@ -1,828 +1,186 @@
|
|
|
|
#include QMK_KEYBOARD_H
|
|
|
|
#include QMK_KEYBOARD_H
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
float tone_caps[][2] = SONG( CAPS_LOCK_ON_SOUND );
|
|
|
|
[0] = LAYOUT_planck_mit(
|
|
|
|
float tone_taps[][2] = SONG( E__NOTE( _A6 ) );
|
|
|
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
|
|
|
#endif
|
|
|
|
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
|
|
|
|
|
|
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP,
|
|
|
|
#define _BASE 0
|
|
|
|
KC_LCTL, KC_LGUI, KC_LALT, KC_LBRC, KC_MINS, LT(1, KC_SPC), KC_EQL, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT,
|
|
|
|
#define _CODE 1
|
|
|
|
KC_VOLD, KC_VOLU, KC_PGDN, KC_PGUP),
|
|
|
|
#define _NAVI 2
|
|
|
|
[1] = LAYOUT_planck_mit(
|
|
|
|
#define _FUNC 3
|
|
|
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
|
|
|
|
#define _SYMB 4
|
|
|
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
|
|
|
#define _NUMB 5
|
|
|
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
|
|
|
#define _MARO 6
|
|
|
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS,
|
|
|
|
#define _RGB 7
|
|
|
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
|
|
|
#define _ADJUST 8
|
|
|
|
};
|
|
|
|
#define _GAME 9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* RGB colors */
|
|
|
|
|
|
|
|
#define RGB_Layer_1_Base_Color 0, 128, 0
|
|
|
|
|
|
|
|
#define RGB_Layer_2_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_3_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_4_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_5_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_6_Base_Color 64, 0, 64
|
|
|
|
|
|
|
|
#define RGB_Layer_7_Base_Color 0, 0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_8_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Layer_9_Base_Color 0,0,0
|
|
|
|
|
|
|
|
#define RGB_Caps_Color 6,50,50
|
|
|
|
|
|
|
|
#define RGB_TAP_On_Color 0,128,0
|
|
|
|
|
|
|
|
#define RGB_TAP_Off_Color 128,0,0
|
|
|
|
|
|
|
|
#define RGB_TAP_Base_Color 0,0,0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern rgblight_config_t rgblight_config;
|
|
|
|
extern rgblight_config_t rgblight_config;
|
|
|
|
bool NUMLAY_STATUS = false;
|
|
|
|
|
|
|
|
int RGB_LAYER0_mode = 6;
|
|
|
|
int RGB_LAYER0_mode = 6;
|
|
|
|
bool RGB_TAP_STATE = false;
|
|
|
|
|
|
|
|
static uint8_t current_layer = 0;
|
|
|
|
static uint8_t current_layer = 0;
|
|
|
|
static bool has_layer_changed = true;
|
|
|
|
static bool has_layer_changed = true;
|
|
|
|
static bool save_rgbmode = true;
|
|
|
|
uint16_t i = 0;
|
|
|
|
static bool caps = false;
|
|
|
|
uint16_t j = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/* Tap Dance function */
|
|
|
|
|
|
|
|
void dance_cln_finished( qk_tap_dance_state_t* state, void* user_data )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( state->count == 1 )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
register_code( KC_LSFT );
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
layer_on( _SYMB );
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
PLAY_SONG( tone_taps );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void dance_cln_reset( qk_tap_dance_state_t* state, void* user_data )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( state->count == 1 )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
unregister_code( KC_LSFT );
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
uint8_t layer = biton32( layer_state );
|
|
|
|
|
|
|
|
if ( layer == _SYMB )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
layer_off( _SYMB );
|
|
|
|
|
|
|
|
rgblight_mode( RGB_LAYER0_mode );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum my_keycodes {
|
|
|
|
|
|
|
|
RGB_TAP = SAFE_RANGE,
|
|
|
|
|
|
|
|
KC_00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Tap Dance Declarations */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
|
|
|
TD_Mute_Next = 0,
|
|
|
|
|
|
|
|
TD_SFT,
|
|
|
|
|
|
|
|
TD_LBRC,
|
|
|
|
|
|
|
|
TD_RBRC
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Tap Dance Definitions */
|
|
|
|
|
|
|
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
|
|
|
|
|
|
|
[TD_Mute_Next] = ACTION_TAP_DANCE_DOUBLE( KC_MUTE, KC_MNXT )
|
|
|
|
|
|
|
|
,[TD_SFT] = ACTION_TAP_DANCE_FN_ADVANCED( NULL, dance_cln_finished, dance_cln_reset )
|
|
|
|
|
|
|
|
,[TD_LBRC] = ACTION_TAP_DANCE_DOUBLE( KC_LBRC, KC_LCBR )
|
|
|
|
|
|
|
|
,[TD_RBRC] = ACTION_TAP_DANCE_DOUBLE( KC_RBRC, KC_RCBR )
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
/* BASE - QWERTY
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | BS |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* shift + Esc = ~ --> | Esc | A | S | D | F | G | H | J | K | L | ; | Enter| <-- shift + Enter = "
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | Shift| Z | X | C | V | B | N | M | , | . | / | Mute |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------| <-- tap: 1.Mute 2.Next
|
|
|
|
|
|
|
|
* | Ctrl | GUI | Alt | [ | - | Space | = | ] | Fx | \ | Del |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_BASE] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
LT( _ADJUST,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
|
|
|
|
|
|
|
LT( _NUMB,KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, LT( _RGB, KC_L ), KC_SCLN, KC_ENT,
|
|
|
|
|
|
|
|
TD( TD_SFT ), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, TD( TD_Mute_Next ),
|
|
|
|
|
|
|
|
KC_LCTL, KC_LGUI, KC_LALT, TD( TD_LBRC ), LT( _NAVI, KC_MINS ), LT( _CODE, KC_SPC ), LT( _FUNC, KC_EQL ), TD( TD_RBRC ), KC_LEFT, KC_DOWN, KC_RGHT ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Code
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | ` | < | [ | { | ( | & | Left | Down | Up | Down | ; | ' |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | > | ] | } | ) | | | | | , | . | / | Play |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | [ | BkSp | ======= | Del | ] | | \ | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_CODE] = LAYOUT_planck_mit( /* 1 - Code */
|
|
|
|
|
|
|
|
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
|
|
|
|
|
|
|
KC_GRV, KC_LABK, KC_LBRC, KC_LCBR, KC_LPRN, KC_AMPR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_QUOT,
|
|
|
|
|
|
|
|
_______, KC_RABK, KC_RBRC, KC_RCBR, KC_RPRN, KC_PIPE, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, KC_MPLY,
|
|
|
|
|
|
|
|
_______, _______, _______, KC_LBRC, KC_BSPC, _______, KC_DEL, KC_RBRC, _______, KC_BSLS, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Navi
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | | | PgUp | | | | |Insert| |Prtsc | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | ~ | | Home | PgDn | End | | | | |SrcLck| | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | Break| | | | | PgUp | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | Home | PgDn | End |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_NAVI] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
_______, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, _______,
|
|
|
|
|
|
|
|
KC_TILD, XXXXXXX, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, _______, _______,
|
|
|
|
|
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Func
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | F11 | F12 | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_FUNC] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
_______ , KC_F1, KC_F2 , KC_F3, KC_F4, KC_F5, KC_F6 , KC_F7, KC_F8, KC_F9, KC_F10, _______,
|
|
|
|
|
|
|
|
_______ , KC_F12, KC_F12 , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
|
|
|
|
|
|
|
|
_______ , XXXXXXX, XXXXXXX , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
|
|
|
|
|
|
|
|
_______ , _______, _______ , _______, _______, _______, _______ , _______, _______, _______, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Symb - double tap shift
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | : | " |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | < | > | ? | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | { | _ | | + | } | | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_SYMB] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
KC_PIPE, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
|
|
|
|
|
|
|
|
KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_COLN, KC_DQUO,
|
|
|
|
|
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LABK, KC_RABK, KC_QUES, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, KC_LCBR, KC_UNDS, _______, KC_PLUS, KC_RCBR, _______, KC_PIPE, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Number
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | + | - | | | | | 7 | 8 | 9 | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | * | / | = | | | | 4 | 5 | 6 | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | 1 | 2 | 3 | |Layer0|
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | 0 | 00 | . | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_NUMB] = LAYOUT_planck_mit( /* 5 - Numpad */
|
|
|
|
|
|
|
|
_______, KC_PPLS, KC_PMNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, _______,
|
|
|
|
|
|
|
|
_______, KC_PAST, KC_PSLS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, _______,
|
|
|
|
|
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX, TO( 0 ),
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, XXXXXXX, KC_0, KC_00, KC_DOT, XXXXXXX, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* MARO Empty
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_MARO] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* RGB
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | | | | | _TAP | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | MOD | M_R | M_SW | M_K | M_X | M_G | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | HUI | SAI | VAI | | | | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | HUD | SAD | VAD | | | RGB_TOG | | | | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_RGB] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, RGB_TAP, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
RGB_MOD, RGB_M_R, RGB_M_SW, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, RGB_TOG, _______, _______, _______, _______, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Func
|
|
|
|
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
|
|
|
|
* | | | | | | | | | | |Layer0| Rest |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | Caps | | | | | Game | | | | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | Numb | Music| | | | |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_ADJUST] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO( 0 ), RESET ,
|
|
|
|
|
|
|
|
KC_CAPS, _______, _______, _______, _______, TO(_GAME), _______, _______, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, TO(_NUMB), MU_TOG, _______, _______, _______, _______,
|
|
|
|
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[_GAME] = LAYOUT_planck_mit(
|
|
|
|
|
|
|
|
XXXXXXX,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX,
|
|
|
|
|
|
|
|
XXXXXXX,KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
|
|
|
|
|
|
|
XXXXXXX,KC_LCTL, KC_A, KC_S, KC_D, KC_B, KC_N, KC_M, XXXXXXX, XXXXXXX, KC_UP, TO( 0 ),
|
|
|
|
|
|
|
|
XXXXXXX,KC_LSFT, KC_Z, KC_X, KC_C, KC_SPC, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT ),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Encoder */
|
|
|
|
|
|
|
|
static uint8_t encoder_state = 0;
|
|
|
|
|
|
|
|
static int8_t encoder_value = 0;
|
|
|
|
|
|
|
|
static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Timer */
|
|
|
|
|
|
|
|
static uint16_t TAP_RGB_timer;
|
|
|
|
|
|
|
|
static uint16_t RGB_encoder_timer;
|
|
|
|
static uint16_t RGB_encoder_timer;
|
|
|
|
|
|
|
|
static uint16_t RGB_encoder_timer2;
|
|
|
|
|
|
|
|
static uint8_t RGB_encoder_dir = 0;
|
|
|
|
|
|
|
|
|
|
|
|
/* Encoder state RGB_display */
|
|
|
|
const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {
|
|
|
|
static uint8_t RGB_encoder_count=6;
|
|
|
|
30,
|
|
|
|
static bool RGB_encoder_bool = false;
|
|
|
|
5,
|
|
|
|
|
|
|
|
-5
|
|
|
|
/* RGB tap HUE */
|
|
|
|
};
|
|
|
|
static uint16_t Type_Hue=270;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void matrix_init_user( void )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
wait_ms( 200 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Encoder init */
|
|
|
|
|
|
|
|
encoder_state = PIND & 0x3;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Timer init */
|
|
|
|
void matrix_init_user(void) {
|
|
|
|
RGB_encoder_timer = timer_read();
|
|
|
|
RGB_encoder_timer = timer_read();
|
|
|
|
TAP_RGB_timer= timer_read();
|
|
|
|
RGB_encoder_timer2 = timer_read();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void matrix_scan_user(void) {
|
|
|
|
void matrix_scan_user( void )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Layer */
|
|
|
|
|
|
|
|
uint8_t layer = biton32(layer_state);
|
|
|
|
uint8_t layer = biton32(layer_state);
|
|
|
|
|
|
|
|
|
|
|
|
/* Encoder */
|
|
|
|
if (RGB_encoder_dir != 0) {
|
|
|
|
encoder_state <<= 2;
|
|
|
|
if (timer_elapsed(RGB_encoder_timer) > 1400) {
|
|
|
|
encoder_state |= (PIND & 0x3);
|
|
|
|
RGB_encoder_dir = 0;
|
|
|
|
encoder_value += encoder_LUT[encoder_state & 0xF];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Encoder state RGB display */
|
|
|
|
|
|
|
|
if (RGB_encoder_bool){
|
|
|
|
|
|
|
|
if (timer_elapsed(RGB_encoder_timer) > 2500) {
|
|
|
|
|
|
|
|
RGB_encoder_bool=false;
|
|
|
|
|
|
|
|
if (RGB_TAP_STATE) {
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb( RGB_TAP_Base_Color );
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
rgblight_mode(RGB_LAYER0_mode);
|
|
|
|
rgblight_mode(RGB_LAYER0_mode);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
if (timer_elapsed(RGB_encoder_timer2) > 700) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Display the Caps state */
|
|
|
|
|
|
|
|
if (caps==true){
|
|
|
|
|
|
|
|
rgblight_setrgb_at(RGB_Caps_Color,12);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of Encoder clockwise */
|
|
|
|
|
|
|
|
if ( encoder_value >= 4 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of Encoder state RGB_display */
|
|
|
|
|
|
|
|
if (!RGB_encoder_bool){
|
|
|
|
|
|
|
|
RGB_encoder_timer=timer_read();
|
|
|
|
|
|
|
|
RGB_encoder_bool=true;
|
|
|
|
|
|
|
|
RGB_encoder_count=5;
|
|
|
|
|
|
|
|
rgblight_mode(1);
|
|
|
|
|
|
|
|
rgblight_setrgb( 0,0,0 );
|
|
|
|
|
|
|
|
}else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) {
|
|
|
|
|
|
|
|
RGB_encoder_timer=timer_read();
|
|
|
|
|
|
|
|
RGB_encoder_count-=1;
|
|
|
|
|
|
|
|
if (RGB_encoder_count>5 || RGB_encoder_count<1){
|
|
|
|
|
|
|
|
RGB_encoder_count=5;
|
|
|
|
|
|
|
|
rgblight_setrgb(0, 0, 0);
|
|
|
|
rgblight_setrgb(0, 0, 0);
|
|
|
|
|
|
|
|
RGB_encoder_timer2 = timer_read();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (timer_elapsed(RGB_encoder_timer2) > 80) {
|
|
|
|
|
|
|
|
if (RGB_encoder_dir == 1) {
|
|
|
|
|
|
|
|
rgblight_setrgb_at(128, 128, 0, 19);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rgblight_setrgb_at(128, 128, 0, 16);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rgblight_setrgb_at(0,255,0,5);
|
|
|
|
|
|
|
|
if (RGB_encoder_count<1) {RGB_encoder_count=1;}
|
|
|
|
|
|
|
|
switch (RGB_encoder_count) {
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 255, 0,4);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 255, 0,3);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 255, 0,2);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 255, 0,1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 255, 0,0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of Encoder state RGB_display */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of Set Encoder Keycode */
|
|
|
|
|
|
|
|
switch ( layer )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
tap_code( KC_VOLD );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _CODE:
|
|
|
|
|
|
|
|
tap_code( KC_LEFT );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _RGB:
|
|
|
|
|
|
|
|
rgblight_decrease_val();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _NUMB:
|
|
|
|
|
|
|
|
tap_code( KC_LEFT );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _MARO:
|
|
|
|
|
|
|
|
tap_code( KC_UP );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
tap_code( KC_VOLD );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of Set Encoder Keycode */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (timer_elapsed(RGB_encoder_timer2) > 180) {
|
|
|
|
/* End of Encoder clockwise */
|
|
|
|
if (RGB_encoder_dir == 1) {
|
|
|
|
|
|
|
|
rgblight_setrgb_at(160, 160, 0, 8);
|
|
|
|
/* Start of Encoder anti-clockwise */
|
|
|
|
} else {
|
|
|
|
if ( encoder_value <= -4 )
|
|
|
|
rgblight_setrgb_at(160, 160, 0, 3);
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Start of Encoder state RGB_display */
|
|
|
|
|
|
|
|
if (!RGB_encoder_bool){
|
|
|
|
|
|
|
|
RGB_encoder_timer=timer_read();
|
|
|
|
|
|
|
|
RGB_encoder_bool=true;
|
|
|
|
|
|
|
|
RGB_encoder_count=6;
|
|
|
|
|
|
|
|
rgblight_mode(1);
|
|
|
|
|
|
|
|
rgblight_setrgb( 0,0,0 );
|
|
|
|
|
|
|
|
}else if (RGB_encoder_bool && timer_elapsed(RGB_encoder_timer) < 800) {
|
|
|
|
|
|
|
|
RGB_encoder_timer=timer_read();
|
|
|
|
|
|
|
|
RGB_encoder_count+=1;
|
|
|
|
|
|
|
|
if (RGB_encoder_count<6 || RGB_encoder_count> 10){
|
|
|
|
|
|
|
|
RGB_encoder_count=6;
|
|
|
|
|
|
|
|
rgblight_setrgb(0, 0, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rgblight_setrgb_at(0, 0,255,6);
|
|
|
|
if (timer_elapsed(RGB_encoder_timer2) > 280) {
|
|
|
|
if (RGB_encoder_count>11) {
|
|
|
|
if (RGB_encoder_dir == 1) {
|
|
|
|
RGB_encoder_count=11;
|
|
|
|
rgblight_setrgb_at(192, 192, 0, 9);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rgblight_setrgb_at(192, 192, 0, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (RGB_encoder_count) {
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0,255,7);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0,255,8);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0,255,9);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0,255,10);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10:
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0,128,11);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* End of Encoder state RGB_display */
|
|
|
|
if (timer_elapsed(RGB_encoder_timer2) > 400) {
|
|
|
|
|
|
|
|
if (RGB_encoder_dir == 1) {
|
|
|
|
/* Start of Set Encoder Keycode */
|
|
|
|
rgblight_setrgb_at(224, 224, 0, 10);
|
|
|
|
switch ( layer )
|
|
|
|
} else {
|
|
|
|
{
|
|
|
|
rgblight_setrgb_at(224, 224, 0, 1);
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
tap_code( KC_VOLU );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _CODE:
|
|
|
|
|
|
|
|
tap_code( KC_RGHT );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _RGB:
|
|
|
|
|
|
|
|
rgblight_increase_val();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _NUMB:
|
|
|
|
|
|
|
|
tap_code( KC_RGHT );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _MARO:
|
|
|
|
|
|
|
|
tap_code( KC_DOWN );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
tap_code( KC_VOLU );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* End of Set Encoder Keycode */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* End of Encoder anti-clockwise */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
encoder_value %= 4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of RGB with Layer change */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Save the Layer0 RGB state */
|
|
|
|
|
|
|
|
if ( save_rgbmode == true ) {
|
|
|
|
|
|
|
|
if (RGB_TAP_STATE==false)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
save_rgbmode = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* When the layer is changed */
|
|
|
|
/* layer rgb */
|
|
|
|
if ( layer != current_layer && caps == false) {
|
|
|
|
if (layer != current_layer) {
|
|
|
|
has_layer_changed = true;
|
|
|
|
has_layer_changed = true;
|
|
|
|
current_layer = layer; /* update layer information */
|
|
|
|
current_layer = layer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for layer change, and apply color if its changed since last check */
|
|
|
|
|
|
|
|
if ( has_layer_changed )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/* change backlight based on layer. These should be numbers or whatever you defined the layers as */
|
|
|
|
|
|
|
|
switch ( layer )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if the key tap RGB effect is enable */
|
|
|
|
|
|
|
|
if (RGB_TAP_STATE==true){
|
|
|
|
|
|
|
|
rgblight_mode(1);
|
|
|
|
|
|
|
|
rgblight_setrgb( RGB_TAP_Base_Color );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
rgblight_mode( RGB_LAYER0_mode );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
if (has_layer_changed) {
|
|
|
|
|
|
|
|
if (layer == 0) {
|
|
|
|
case _CODE: //1
|
|
|
|
|
|
|
|
/* Save Layer0 RGB state */
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* set all the RGB color under the switch */
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_1_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* set each of the RGB led color under the switch */
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,1); // Q
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,2); // W
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,3); // E
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,4); // R
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,5); // T
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,6); // Y
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,7); // U
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,8); // I
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,9); // O
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 64,10); // P
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 0,40); // -
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 0,42); // =
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case _NAVI: //2
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_2_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 64,3);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 64,14);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 64,15);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 64,16);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 0,8);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 0,10);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 0,21);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 64, 0,29);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64, 0, 0,11);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,34);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,44);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,45);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,46);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _FUNC: //3
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_3_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,1);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,2);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,3);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,4);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,5);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,6);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,7);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,8);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,9);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,10);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,13);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 0, 64,14);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case _SYMB: //4
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_4_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,1);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,2);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,3);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,4);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,5);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,6);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,7);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,8);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,9);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,10);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,12);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,22);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,23);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,32);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,33);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,34);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,39);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,40);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,42);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0, 64, 64,43);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case _NUMB: //5
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_5_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,1);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,2);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,13);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,14);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,64,15);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,7);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,8);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,9);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,19);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,20);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,21);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,31);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,32);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,33);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,42);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,43);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,128,0,44);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _MARO: //6
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_6_Base_Color);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case _RGB: //7
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_7_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(1,143,225,0);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(39,21,107,1);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(208,0,0,2);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,64,64,21);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case _ADJUST: //8
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_8_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,10);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,0,0,11);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,17);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,64,0,30);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(6,50,50,12);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case _GAME: //9
|
|
|
|
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb(RGB_Layer_9_Base_Color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,0,64,15);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,0,64,26);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,0,64,27);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(0,0,64,28);
|
|
|
|
|
|
|
|
rgblight_setrgb_at(64,0,0,35);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
rgblight_mode(RGB_LAYER0_mode);
|
|
|
|
rgblight_mode(RGB_LAYER0_mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
has_layer_changed = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of RGB with Layer change */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // End of matrix_scan_user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* shift + enter = " from:https://github.com/qmk/qmk_firmware/blob/e899cb8940da04fa2610604f0aab417db7fac119/keyboards/mitosis/keymaps/datagrok/keymap.c */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool comm_shifted = false;
|
|
|
|
|
|
|
|
bool ques_shifted = false;
|
|
|
|
|
|
|
|
static uint8_t key_index = 0;
|
|
|
|
|
|
|
|
uint8_t shifted;
|
|
|
|
|
|
|
|
uint16_t s_keycode;
|
|
|
|
|
|
|
|
bool *k_shifted;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool process_record_user( uint16_t keycode, keyrecord_t *record ){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Start of key tap RGB effect */
|
|
|
|
|
|
|
|
if ( RGB_TAP_STATE ==true ) {
|
|
|
|
|
|
|
|
key_index=(record->event.key.col)+(record->event.key.row)*12;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Change the Hue of the RGB color with the type speed */
|
|
|
|
|
|
|
|
if (timer_elapsed(TAP_RGB_timer) >10000){
|
|
|
|
|
|
|
|
TAP_RGB_timer=timer_read();
|
|
|
|
|
|
|
|
Type_Hue=270;
|
|
|
|
|
|
|
|
}else if (timer_elapsed(TAP_RGB_timer) >1000){
|
|
|
|
|
|
|
|
Type_Hue+=30;
|
|
|
|
|
|
|
|
if (Type_Hue>270) {
|
|
|
|
|
|
|
|
Type_Hue=270;}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
TAP_RGB_timer=timer_read();
|
|
|
|
|
|
|
|
Type_Hue-=10;
|
|
|
|
|
|
|
|
if (Type_Hue<10) {
|
|
|
|
|
|
|
|
Type_Hue=10;}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (key_index>42){ //fix the RGB index of the MIT layout position
|
|
|
|
|
|
|
|
key_index=key_index-1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( record->event.pressed ) {
|
|
|
|
|
|
|
|
rgblight_sethsv_at(Type_Hue,255,255,key_index);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rgblight_setrgb_at(RGB_TAP_Base_Color,key_index);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of key tap RGB effect */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch ( keycode )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/* save the RGB state when set the new */
|
|
|
|
|
|
|
|
case RGB_M_R:
|
|
|
|
|
|
|
|
save_rgbmode = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RGB_M_SW:
|
|
|
|
|
|
|
|
save_rgbmode = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RGB_M_X:
|
|
|
|
|
|
|
|
save_rgbmode = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RGB_M_G:
|
|
|
|
|
|
|
|
save_rgbmode = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RGB_MODE_KNIGHT:
|
|
|
|
|
|
|
|
save_rgbmode = true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Define a New Keycode: double zero */
|
|
|
|
|
|
|
|
case KC_00:
|
|
|
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
|
|
|
// Do something when pressed
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
tap_code( KC_0 ); // send 0
|
|
|
|
|
|
|
|
tap_code( KC_0 ); // send 0 twice without macro
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false; // Skip all further processing of this key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* when the REST key is pressed the 'R' key will RED,the "Bottom Left"(esc of qmk-dfu) will be GREEN */
|
|
|
|
|
|
|
|
case RESET:
|
|
|
|
|
|
|
|
rgblight_mode(1);
|
|
|
|
rgblight_mode(1);
|
|
|
|
rgblight_setrgb( 0, 0, 0 );
|
|
|
|
for (i = 0; i < 48; i++) {
|
|
|
|
rgblight_setrgb_at(128, 0, 0,4); // R
|
|
|
|
(i > 41) ? (j = i - 1) : (j = i);
|
|
|
|
rgblight_setrgb_at(6, 128, 24,36); // Bottom Left key
|
|
|
|
uint16_t kc = keymap_key_to_keycode(layer, (keypos_t) {.row = 0, .col = i
|
|
|
|
break;
|
|
|
|
});
|
|
|
|
|
|
|
|
if (kc == KC_TRNS) {
|
|
|
|
/* Define a New Keycode: key tap RGB effect toggle */
|
|
|
|
setrgb(5, 5, 5, (LED_TYPE * ) & led[j]); /* TRNS color 0-255*/
|
|
|
|
case RGB_TAP:
|
|
|
|
} else if (kc == KC_NO) {
|
|
|
|
if ( !(record->event.pressed)) {
|
|
|
|
setrgb(0, 0, 0, (LED_TYPE * ) & led[j]); /* NO color 0-255*/
|
|
|
|
/* If enable,the 'On' key will be green */
|
|
|
|
|
|
|
|
if (RGB_TAP_STATE) {
|
|
|
|
|
|
|
|
RGB_TAP_STATE=false;
|
|
|
|
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
|
|
|
|
rgblight_setrgb( RGB_TAP_Base_Color );
|
|
|
|
|
|
|
|
rgblight_setrgb_at(RGB_TAP_Off_Color,16); // O - on
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
/* If disenable,the 'oFf' key will be red */
|
|
|
|
if (layer == 1) {
|
|
|
|
RGB_TAP_STATE=true;
|
|
|
|
setrgb(128, 64, 0, (LED_TYPE * ) & led[j]); /* 1 layer 0-255*/
|
|
|
|
rgblight_mode( 1 );
|
|
|
|
} else if (layer == 2) {
|
|
|
|
rgblight_setrgb( RGB_TAP_Base_Color );
|
|
|
|
setrgb(0, 64, 128, (LED_TYPE * ) & led[j]); /* 2*/
|
|
|
|
rgblight_setrgb_at(RGB_TAP_On_Color,9); // F - off
|
|
|
|
} else if (layer == 3) {
|
|
|
|
|
|
|
|
setrgb(64, 128, 0, (LED_TYPE * ) & led[j]); /* 3*/
|
|
|
|
|
|
|
|
} else if (layer == 4) {
|
|
|
|
|
|
|
|
setrgb(0, 128, 64, (LED_TYPE * ) & led[j]); /* 4*/
|
|
|
|
|
|
|
|
} else if (layer == 5) {
|
|
|
|
|
|
|
|
setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 5*/
|
|
|
|
|
|
|
|
} else if (layer == 6) {
|
|
|
|
|
|
|
|
setrgb(128, 0, 128, (LED_TYPE * ) & led[j]); /* 6*/
|
|
|
|
|
|
|
|
} else if (layer == 7) {
|
|
|
|
|
|
|
|
setrgb(128, 128, 0, (LED_TYPE * ) & led[j]); /* 7*/
|
|
|
|
|
|
|
|
} else if (layer == 8) {
|
|
|
|
|
|
|
|
setrgb(0, 128, 128, (LED_TYPE * ) & led[j]); /* 8*/
|
|
|
|
|
|
|
|
} else if (layer == 9) {
|
|
|
|
|
|
|
|
setrgb(128, 192, 64, (LED_TYPE * ) & led[j]); /* 9*/
|
|
|
|
|
|
|
|
} else if (layer == 10) {
|
|
|
|
|
|
|
|
setrgb(64, 192, 128, (LED_TYPE * ) & led[j]); /* 10*/
|
|
|
|
|
|
|
|
} else if (layer == 11) {
|
|
|
|
|
|
|
|
setrgb(128, 64, 192, (LED_TYPE * ) & led[j]); /* 11*/
|
|
|
|
|
|
|
|
} else if (layer == 12) {
|
|
|
|
|
|
|
|
setrgb(64, 128, 192, (LED_TYPE * ) & led[j]); /* 12*/
|
|
|
|
|
|
|
|
} else if (layer == 13) {
|
|
|
|
|
|
|
|
setrgb(128, 192, 0, (LED_TYPE * ) & led[j]); /* 13*/
|
|
|
|
|
|
|
|
} else if (layer == 14) {
|
|
|
|
|
|
|
|
setrgb(192, 0, 128, (LED_TYPE * ) & led[j]); /* 14*/
|
|
|
|
|
|
|
|
} else if (layer == 15) {
|
|
|
|
|
|
|
|
setrgb(0, 192, 128, (LED_TYPE * ) & led[j]); /* 15*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
rgblight_set();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
has_layer_changed = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* end of layer rgb */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* special shift keys */
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t * record) {
|
|
|
|
case KC_ENT:
|
|
|
|
switch (keycode) {
|
|
|
|
s_keycode = KC_QUOT;
|
|
|
|
case RGB_MOD:
|
|
|
|
k_shifted = &ques_shifted;
|
|
|
|
RGB_LAYER0_mode = rgblight_config.mode;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KC_UP:
|
|
|
|
|
|
|
|
s_keycode = KC_SLSH;
|
|
|
|
|
|
|
|
k_shifted = &ques_shifted;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KC_DOWN:
|
|
|
|
|
|
|
|
s_keycode = KC_BSLS;
|
|
|
|
|
|
|
|
k_shifted = &ques_shifted;
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return (true);
|
|
|
|
return (true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
shifted = get_mods() & (MOD_BIT( KC_LSHIFT ) | MOD_BIT( KC_RSHIFT ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Keydown. If shift is currently pressed, register its alternate keycode. */
|
|
|
|
|
|
|
|
if ( record->event.pressed && shifted )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
*k_shifted = true;
|
|
|
|
|
|
|
|
register_code( s_keycode );
|
|
|
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* Keyup. If shift was pressed back when the key was pressed, unregister
|
|
|
|
|
|
|
|
* its alternate keycode.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
} else if ( !(record->event.pressed) && *k_shifted ) {
|
|
|
|
|
|
|
|
*k_shifted = false;
|
|
|
|
|
|
|
|
unregister_code( s_keycode );
|
|
|
|
|
|
|
|
return(false);
|
|
|
|
|
|
|
|
/* Otherwise, behave as normal. */
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return (true);
|
|
|
|
return (true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // End ofprocess_record_user
|
|
|
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
|
|
|
|
|
|
|
RGB_encoder_timer = timer_read();
|
|
|
|
|
|
|
|
RGB_encoder_timer2 = timer_read();
|
|
|
|
void led_set_user( uint8_t usb_led )
|
|
|
|
uint8_t layer = biton32(layer_state);
|
|
|
|
{
|
|
|
|
if (clockwise) {
|
|
|
|
static uint8_t old_usb_led = 0;
|
|
|
|
RGB_encoder_dir = 1;
|
|
|
|
wait_ms( 10 ); /* gets rid of tick */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) {
|
|
|
|
|
|
|
|
/* CAPS on */
|
|
|
|
|
|
|
|
caps= true;
|
|
|
|
|
|
|
|
rgblight_setrgb( 0,0,0 );
|
|
|
|
|
|
|
|
rgblight_setrgb_at(RGB_Caps_Color,12); // caps key
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
PLAY_SONG( tone_caps );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}else if ( !(usb_led & (1 << USB_LED_CAPS_LOCK) ) && (old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* CAPS off */
|
|
|
|
|
|
|
|
caps= false;
|
|
|
|
|
|
|
|
if (RGB_TAP_STATE==false){
|
|
|
|
|
|
|
|
rgblight_mode( RGB_LAYER0_mode );
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
rgblight_mode(1);
|
|
|
|
RGB_encoder_dir = -1;
|
|
|
|
rgblight_setrgb( 0,0,0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (index == 0) /* Right encoder */ {
|
|
|
|
|
|
|
|
if (clockwise) {
|
|
|
|
|
|
|
|
register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 11
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 10
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (index == 1) /* Left encoder */ {
|
|
|
|
|
|
|
|
if (clockwise) {
|
|
|
|
|
|
|
|
register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 1
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
register_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
unregister_code(keymap_key_to_keycode(layer, (keypos_t) {.row = 4, .col = 0
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
PLAY_SONG( tone_caps );
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
old_usb_led = usb_led;
|
|
|
|
|
|
|
|
} // End of led_set_user
|
|
|
|
|
|
|
|