Created
June 24, 2021 13:10
-
-
Save icanswiftabit/4da8d57b63295f4184c366a9fd396f77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
[0] = LAYOUT( /* Base */ | |
KC_MUTE, KC_MPLY, | |
KC_LSHIFT, KC_7, KC_8, KC_9, | |
KC_LCTRL, KC_4, KC_5, KC_6, | |
KC_LALT, KC_1, KC_2, KC_3, | |
KC_LGUI, TG(1), KC_0, KC_DOLLAR | |
), | |
[1] = LAYOUT( /* Meeting Controls */ | |
_______, _______, | |
LSFT(KC_F18), _______, _______, _______, | |
LCTL(KC_F18), _______, _______, _______, | |
LALT(KC_F18), _______, _______, _______, | |
LGUI(KC_F18), _______, _______, _______ | |
), | |
[2] = LAYOUT( | |
_______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______ | |
), | |
[3] = LAYOUT( | |
_______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______, | |
_______, _______, _______, _______ | |
), | |
}; | |
const rgblight_segment_t PROGMEM layer0_layer[] = RGBLIGHT_LAYER_SEGMENTS( | |
{0,16,0} | |
); | |
const rgblight_segment_t PROGMEM meeting_layer[] = RGBLIGHT_LAYER_SEGMENTS( | |
{0,16,HSV_GREEN} | |
); | |
const rgblight_segment_t PROGMEM mic_layer[] = RGBLIGHT_LAYER_SEGMENTS( | |
{0,16,HSV_RED} | |
); | |
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( | |
layer0_layer, | |
meeting_layer, | |
mic_layer | |
); | |
layer_state_t default_layer_state_set_user(layer_state_t state) { | |
rgblight_set_layer_state(0, layer_state_cmp(state, 0)); | |
return state; | |
} | |
layer_state_t layer_state_set_user(layer_state_t state) { | |
rgblight_set_layer_state(1, layer_state_cmp(state, 1)); | |
return state; | |
} | |
void keyboard_post_init_user(void) { | |
// Enable the LED layers | |
rgblight_layers = my_rgb_layers; | |
layer_state_set_user(layer_state); | |
} | |
void encoder_update_user(uint8_t index, bool clockwise) { | |
if (index == 0) { /* Left Encoder */ | |
if (clockwise) { | |
tap_code(KC_VOLU); | |
} else { | |
tap_code(KC_VOLD); | |
} | |
} else if (index == 1) { /* Right Encoder */ | |
if (clockwise) { | |
tap_code(KC_MNXT); | |
} else { | |
tap_code(KC_MPRV); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment