diff --git a/keyboards/lets_split/keymaps/default/config.h b/keyboards/lets_split/keymaps/default/config.h index 5a6261c4f7cf..60e23f816d29 100644 --- a/keyboards/lets_split/keymaps/default/config.h +++ b/keyboards/lets_split/keymaps/default/config.h @@ -18,20 +18,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" + // place overrides here +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } /* Use I2C or Serial, not both */ - #define USE_SERIAL // #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index f782781843df..05f9bda8d8be 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; - // 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 @@ -16,15 +14,12 @@ extern keymap_config_t keymap_config; enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, + DVORAK }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -138,74 +133,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -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); +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } 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); + set_single_persistent_default_layer(_QWERTY); } return false; - break; case COLEMAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); + set_single_persistent_default_layer(_COLEMAK); } return false; - break; case DVORAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); + set_single_persistent_default_layer(_DVORAK); } return false; - break; } return true; } diff --git a/keyboards/lets_split/keymaps/default/rules.mk b/keyboards/lets_split/keymaps/default/rules.mk index 457a3d01d4a4..e69de29bb2d1 100644 --- a/keyboards/lets_split/keymaps/default/rules.mk +++ b/keyboards/lets_split/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif