Skip to content

Commit

Permalink
Switch to PDF keycodes for default layers
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Nov 27, 2024
1 parent c947f5d commit 1b87908
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
18 changes: 0 additions & 18 deletions users/drashna/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ __attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t
return state;
}

#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
static float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS;
#endif // AUDIO_ENABLE && DEFAULT_LAYER_SONGS

layer_state_t default_layer_state_set_user(layer_state_t state) {
if (!is_keyboard_master()) {
return state;
Expand All @@ -268,20 +264,6 @@ layer_state_t default_layer_state_set_user(layer_state_t state) {
state = default_layer_state_set_rgb_light(state);
#endif // CUSTOM_RGBLIGHT

static bool has_init_been_ran = false;
// We don't want to run this the first time it's called, since it's read from eeeprom and called
// as part of the startup process. But after that, it's okay.
if (has_init_been_ran) {
#if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
if (get_highest_layer(state) < MAX_LAYER) {
PLAY_SONG(default_layer_songs[get_highest_layer(state)]);
}
#endif // AUDIO_ENABLE && DEFAULT_LAYER_SONGS
eeconfig_update_default_layer(state);
} else {
has_init_been_ran = true;
}

#ifdef LAYER_MAP_ENABLE
set_layer_map();
#endif // LAYER_MAP_ENABLE
Expand Down
13 changes: 4 additions & 9 deletions users/drashna/keyrecords/process_records.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,10 @@ void rgb_layer_indication_toggle(void);
#define KC_SEC4 KC_SECRET_4
#define KC_SEC5 KC_SECRET_5

#define KC_QWERTY DF(_QWERTY)
#define KC_COLEMAK_DH DF(_COLEMAK_DH)
#define KC_COLEMAK DF(_COLEMAK)
#define KC_DVORAK DF(_DVORAK)

#define QWERTY KC_QWERTY
#define DVORAK KC_DVORAK
#define COLEMAK KC_COLEMAK
#define CLMKDH KC_COLEMAK_DH
#define QWERTY PDF(_QWERTY)
#define CLMKDH PDF(_COLEMAK_DH)
#define COLEMAK PDF(_COLEMAK)
#define DVORAK PDF(_DVORAK)

#ifdef SWAP_HANDS_ENABLE
# define KC_C1R3 SH_T(KC_TAB)
Expand Down

0 comments on commit 1b87908

Please sign in to comment.