#include "wanleg.h"
// Defines actions for my global custom keycodes. Defined in wanleg.h file
// Then runs the _keymap's record handier if not processed here
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QW);
#if defined(RGBLIGHT_ENABLE)
rgblight_sethsv_noeeprom(0,0,128);
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING);
#endif
}
return false;
break;
case GHERKIN:
set_single_persistent_default_layer(_GK);
rgblight_sethsv_noeeprom(128,255,64);
case gGHERKIN:
set_single_persistent_default_layer(gGK);
rgblight_sethsv_noeeprom(128,255,128);
rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT);
case ONEHAND:
set_single_persistent_default_layer(ONE);
case NUMPAD:
set_single_persistent_default_layer(PAD);
case GHERKIN50:
set_single_persistent_default_layer(GK50);
case SUBTER:
layer_on(SUB);
} else {
layer_off(SUB);
case SUPRA:
layer_on(SUP);
layer_off(SUP);
case NUMBER:
layer_on(NUM);
layer_off(NUM);
case DIRECTION:
layer_on(DIR);
layer_off(DIR);
case ETCETERA:
layer_on(ETC);
layer_off(ETC);
case gNUMBER:
layer_on(gNUM);
layer_off(gNUM);
case gDIRECTION:
layer_on(gDIR);
layer_off(gDIR);
case gETCETERA:
layer_on(gETC);
layer_off(gETC);
case FUNCTION:
layer_on(_FN);
layer_off(_FN);
//on RESET, underglow red if present
case RESET:
rgblight_enable_noeeprom(); // enables Rgb, without saving settings
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
rgblight_sethsv_noeeprom_red();
return true; // Let QMK send the press/release events as normal
return true;
/// Turn off LEDs on ProMicros of Let's Split ///
// LEDs only on by default on Let's Split
// Add reconfigurable functions here, for keymap customization
// This allows for a global, userspace functions, and continued
// customization of the keymap. Use _keymap instead of _user
// functions in the keymaps
__attribute__ ((weak))
void matrix_init_keymap(void) {}
// Call user matrix init, then call the keymap's init function
void matrix_init_user(void) {
//turn off pro micro LEDs
#if defined(KEYBOARD_lets_split_rev2)
DDRD &= ~(1<<5);
PORTD &= ~(1<<5);
DDRB &= ~(1<<0);
PORTB &= ~(1<<0);
//disable backlight breathing for keyboard using random flashing RGB LEDs for backlight
//(breathing provides insufficient power to integrated LED IC)
#if defined(KEYBOARD_kbdfans_kbd6x) && defined(BACKLIGHT_BREATHING)
breathing_disable();
matrix_init_keymap();
//at end of firmware startup process, change powerup default layer and underglow colour for kbd6x
void keyboard_post_init_user(void) {
#if defined(KEYBOARD_kbdfans_kbd6x)
rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5);