summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorrafal0p <rafal0p@outlook.com>2022-11-20 18:23:41 +0100
committerGitHub <noreply@github.com>2022-11-20 17:23:41 +0000
commit852952cfd8e3631177c51a096f793fe9cda679cc (patch)
treecc62c47469bde106c6a6881fadd749c6ed868392 /keyboards
parentca693d7f9b56862c7fecc583637dc5e0265afc99 (diff)
Use modern solution for tri-layer in sofle default layout (#19113)
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/sofle/keymaps/default/keymap.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/keyboards/sofle/keymaps/default/keymap.c b/keyboards/sofle/keymaps/default/keymap.c
index 5729d80271..d4eb0cdcf3 100644
--- a/keyboards/sofle/keymaps/default/keymap.c
+++ b/keyboards/sofle/keymaps/default/keymap.c
@@ -12,9 +12,6 @@ enum sofle_layers {
enum custom_keycodes {
KC_QWERTY = SAFE_RANGE,
KC_COLEMAK,
- KC_LOWER,
- KC_RAISE,
- KC_ADJUST,
KC_PRVWD,
KC_NXTWD,
KC_LSTRT,
@@ -45,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
- KC_LGUI,KC_LALT,KC_LCTRL, KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI
+ KC_LGUI,KC_LALT,KC_LCTRL, MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTRL, KC_RALT, KC_RGUI
),
/*
* COLEMAK
@@ -68,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
- KC_LGUI,KC_LALT,KC_LCTRL,KC_LOWER, KC_ENT, KC_SPC, KC_RAISE, KC_RCTRL, KC_RALT, KC_RGUI
+ KC_LGUI,KC_LALT,KC_LCTRL, MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTRL, KC_RALT, KC_RGUI
),
/* LOWER
* ,-----------------------------------------. ,-----------------------------------------.
@@ -211,6 +208,10 @@ bool oled_task_user(void) {
#endif
+layer_state_t layer_state_set_user(layer_state_t state) {
+ return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
+}
+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_QWERTY:
@@ -223,31 +224,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
- case KC_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;
- case KC_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;
- case KC_ADJUST:
- if (record->event.pressed) {
- layer_on(_ADJUST);
- } else {
- layer_off(_ADJUST);
- }
- return false;
case KC_PRVWD:
if (record->event.pressed) {
if (keymap_config.swap_lctl_lgui) {