Tidy up default layer handling in keymaps (#23436)

This commit is contained in:
Joel Challis 2024-04-08 02:56:46 +01:00 committed by GitHub
parent 11deaf60b4
commit ad8d934d3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 50 additions and 417 deletions

View file

@ -144,12 +144,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
// always enable num lock on layer NL and disable on other layers
// thanks to spidey3 & Erovia on discord
layer_state_t layer_state_set_user(layer_state_t state) {

View file

@ -13,10 +13,6 @@
#define _FN1 2
#define _FN2 3
enum eco_keycodes {
QWERTY = SAFE_RANGE
};
// Defines for task manager and such
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
@ -78,20 +74,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
}
return true;
}

View file

@ -107,11 +107,6 @@ float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -119,7 +114,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -128,7 +123,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -137,7 +132,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -130,8 +130,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}

View file

@ -119,9 +119,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
____, ____, ____, ____
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}

View file

@ -70,8 +70,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}

View file

@ -175,11 +175,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -187,7 +182,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -196,7 +191,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -205,7 +200,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -940,9 +940,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
void persistent_default_layer_set(uint8_t default_layer) {
set_single_persistent_default_layer(default_layer);
#ifdef RGBSPS_ENABLE
led_set_default_layer_indicator();
#endif
@ -1119,14 +1118,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// layout switchers
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
persistent_default_layer_set(_QWERTY);
}
return false;
break;
#ifdef LAYOUT_DVORAK
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
persistent_default_layer_set(_DVORAK);
}
return false;
break;
@ -1134,7 +1133,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_COLEMAK
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_COLEMAK);
persistent_default_layer_set(_COLEMAK);
}
return false;
break;
@ -1142,7 +1141,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_WORKMAN
case WORKMAN:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_WORKMAN);
persistent_default_layer_set(_WORKMAN);
}
return false;
break;
@ -1150,7 +1149,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef LAYOUT_NORMAN
case NORMAN:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_NORMAN);
persistent_default_layer_set(_NORMAN);
}
return false;
break;

View file

@ -201,11 +201,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
// Cases to switch default layer to QWERTY, COLEMAK or DVORAK and to access ADJUST layer
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {

View file

@ -179,11 +179,6 @@ float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
bool TOG_STATUS = false;
int RGB_current_mode;
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
// Setting ADJUST layer RGB back to default
void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
@ -203,7 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -212,7 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -221,7 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -191,11 +191,6 @@ float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
bool TOG_STATUS = false;
int RGB_current_mode;
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
// Setting ADJUST layer RGB back to default
void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
@ -215,7 +210,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -224,7 +219,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -233,7 +228,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -25,8 +25,7 @@ enum layer_names {
// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -112,12 +111,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
// persistant_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -25,8 +25,7 @@ enum layer_names {
// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -112,12 +111,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
// persistant_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -24,8 +24,7 @@ enum layer_names {
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -112,13 +111,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
// persistant_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -24,8 +24,7 @@ enum layer_names {
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -112,13 +111,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
// persistant_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -142,11 +142,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -154,7 +149,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -163,7 +158,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -172,7 +167,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -162,11 +162,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -174,7 +169,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -183,7 +178,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -192,7 +187,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -11,7 +11,7 @@ extern keymap_config_t keymap_config;
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16
#define _ADJUST 5
enum custom_keycodes {
QWERTY = SAFE_RANGE,
@ -159,11 +159,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -171,7 +166,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -180,7 +175,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -189,7 +184,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -142,11 +142,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -154,7 +149,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -163,7 +158,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -172,7 +167,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -1,32 +0,0 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* Select hand configuration */
#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS
#endif

View file

@ -13,7 +13,7 @@ extern keymap_config_t keymap_config;
#define _LOWER 3
#define _RAISE 4
#define _FN 5
#define _ADJUST 16
#define _ADJUST 6
enum custom_keycodes {
QWERTY = SAFE_RANGE,
@ -161,11 +161,6 @@ float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -173,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -182,7 +177,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -191,7 +186,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -70,11 +70,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -70,11 +70,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -70,11 +70,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -62,11 +62,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -79,11 +79,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -79,11 +79,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -21,11 +21,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, RGB_TOG
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -76,11 +76,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_HUD, RGB_SAI, XXXXXXX, XXXXXXX
)
};
void matrix_init_user(void) {
// This keymap only has a single base layer, so reset the default if needed
if (eeconfig_read_default_layer() > 1) {
eeconfig_update_default_layer(1);
default_layer_set(1);
}
}

View file

@ -13,8 +13,7 @@ enum layer_names {
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -114,22 +113,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -9,12 +9,6 @@
#define _FN_1 1
#define _FN_2 2
enum custom_keycodes {
DEFAULT = SAFE_RANGE,
FN_1,
FN_2
};
// Defines for task manager and such
#define CALTDEL LCTL(LALT(KC_DEL))
#define TSKMGR LCTL(LSFT(KC_ESC))
@ -49,15 +43,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// NONE
}
return true;
}

View file

@ -9,8 +9,7 @@ enum layer_names {
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -108,20 +107,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);

View file

@ -10,13 +10,6 @@ enum layer_number {
_NAV
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
NAV,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
@ -67,32 +60,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
//case COLEMAK:
//if (record->event.pressed) {
//#ifdef AUDIO_ENABLE
//PLAY_SONG(tone_colemak);
//#endif
//persistant_default_layer_set(1UL<<_COLEMAK);
//}
//return false;
//break;
}
return true;
}

View file

@ -10,11 +10,6 @@ enum layer_number {
_NAV
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
NAV
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
@ -84,25 +79,6 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(1UL<<_QWERTY);
}
return false;
break;
//case COLEMAK:
//if (record->event.pressed) {
//set_single_persistent_default_layer(1UL<<_COLEMAK);
//}
//return false;
//break;
}
return true;
}
#if OLED_ENABLE
const char* layer_name_user(uint32_t layer) {
switch (layer) {

View file

@ -63,26 +63,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DV);
set_single_persistent_default_layer(_DV);
}
return false;
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QW);
set_single_persistent_default_layer(_QW);
}
return false;
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_CM);
set_single_persistent_default_layer(_CM);
}
return false;
default:

View file

@ -1,6 +1,5 @@
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
@ -8,10 +7,6 @@
#define _NP 0
enum custom_keycodes {
NUMPAD = SAFE_RANGE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NP] = LAYOUT_numpad_4x4( /* Numpad */
KC_P7, KC_P8, KC_P9, KC_PPLS,
@ -20,21 +15,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_P0, KC_PDOT
),
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case NUMPAD:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_NP);
}
return false;
default:
return true;
}
return true;
};

View file

@ -170,7 +170,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
set_single_persistent_default_layer(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -179,7 +179,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
set_single_persistent_default_layer(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
@ -188,7 +188,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
set_single_persistent_default_layer(1UL<<_DVORAK);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

View file

@ -182,7 +182,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
// persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
@ -191,7 +190,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
// persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
@ -200,7 +198,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
// persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;

View file

@ -26,8 +26,7 @@ extern rgblight_config_t rgblight_config;
#define _ADJUST 3
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
@ -104,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_ADJUST] = LAYOUT(
BL_TOGG, QK_BOOT, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL,
BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______,
BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
@ -124,15 +123,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
// persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around