rename layers to left right middle

This commit is contained in:
jacekpoz 2024-09-04 13:23:00 +02:00
parent a924b0ea00
commit c126d5485b
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 26 additions and 26 deletions

View file

@ -5,9 +5,9 @@
enum layer_number { enum layer_number {
_BASE = 0, _BASE = 0,
_LOWER, _LEFT,
_RAISE, _RIGHT,
_ADJUST, _MIDDLE,
}; };
#define CTL_ESC MT(MOD_LCTL, KC_ESC) #define CTL_ESC MT(MOD_LCTL, KC_ESC)
@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------| * |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------|
* |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / | RAlt | * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / | RAlt |
* `-----------------------------------------/ / \ \-----------------------------------------' * `-----------------------------------------/ / \ \-----------------------------------------'
* | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | LAlt | LGUI |LEFT | /Space / \Enter \ |RIGHT |BackSP| RGUI |
* | | | |/ / \ \ | | | | * | | | |/ / \ \ | | | |
* `----------------------------' '------''--------------------' * `----------------------------' '------''--------------------'
*/ */
@ -34,9 +34,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, CTL_ESC, 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, MS_BTN1, MS_BTN2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RALT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MS_BTN1, MS_BTN2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RALT,
KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_ENT, MO(_RAISE), KC_BSPC, KC_RGUI KC_LALT, KC_LGUI, MO(_LEFT), KC_SPC, KC_ENT, MO(_RIGHT), KC_BSPC, KC_RGUI
), ),
/* LOWER /* LEFT
* ,-----------------------------------------. ,-----------------------------------------. * ,-----------------------------------------. ,-----------------------------------------.
* | Esc | | | | | | | | | | | | | * | Esc | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------| * |------+------+------+------+------+------| |------+------+------+------+------+------|
@ -46,18 +46,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------| * |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------|
* | | | | | | |-------| |-------| | _ | + | { | } | | | * | | | | | | |-------| |-------| | _ | + | { | } | | |
* `-----------------------------------------/ / \ \-----------------------------------------' * `-----------------------------------------/ / \ \-----------------------------------------'
* | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | LAlt | LGUI |LEFT | /Space / \Enter \ |RIGHT |BackSP| RGUI |
* | | | |/ / \ \ | | | | * | | | |/ / \ \ | | | |
* `----------------------------' '------''--------------------' * `----------------------------' '------''--------------------'
*/ */
[_LOWER] = LAYOUT( [_LEFT] = LAYOUT(
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD,
_______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______
), ),
/* RAISE /* RIGHT
* ,-----------------------------------------. ,-----------------------------------------. * ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | | * | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------| * |------+------+------+------+------+------| |------+------+------+------+------+------|
@ -67,19 +67,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------| * |------+------+------+------+------+------|MS_BTN1| |MS_BTN2|------+------+------+------+------+------|
* | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ | * | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ |
* `-----------------------------------------/ / \ \-----------------------------------------' * `-----------------------------------------/ / \ \-----------------------------------------'
* | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | LAlt | LGUI |LEFT | /Space / \Enter \ |RIGHT |BackSP| RGUI |
* | | | |/ / \ \ | | | | * | | | |/ / \ \ | | | |
* `----------------------------' '------''--------------------' * `----------------------------' '------''--------------------'
*/ */
[_RAISE] = LAYOUT( [_RIGHT] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX,
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______
), ),
/* ADJUST /* MIDDLE
* ,-----------------------------------------. ,-----------------------------------------. * ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | | * | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------| * |------+------+------+------+------+------| |------+------+------+------+------+------|
@ -89,11 +89,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------| | | |------+------+------+------+------+------| * |------+------+------+------+------+------| | | |------+------+------+------+------+------|
* | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- | * | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- |
* `-----------------------------------------/ / \ \-----------------------------------------' * `-----------------------------------------/ / \ \-----------------------------------------'
* | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | LAlt | LGUI |LEFT | /Space / \Enter \ |RIGHT |BackSP| RGUI |
* | | | |/ / \ \ | | | | * | | | |/ / \ \ | | | |
* `----------------------------' '------''--------------------' * `----------------------------' '------''--------------------'
*/ */
[_ADJUST] = LAYOUT( [_MIDDLE] = LAYOUT(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); return update_tri_layer_state(state, _LEFT, _RIGHT, _MIDDLE);
} }
//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk //SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk

View file

@ -2,10 +2,10 @@
#include <stdio.h> #include <stdio.h>
#define L_BASE 0 #define L_BASE 0
#define L_LOWER (1 << 1) #define L_LEFT (1 << 1)
#define L_RAISE (1 << 2) #define L_RIGHT (1 << 2)
#define L_ADJUST (1 << 3) #define L_MIDDLE (1 << 3)
#define L_ADJUST_TRI (L_ADJUST | L_RAISE | L_LOWER) #define L_MIDDLE_TRI (L_MIDDLE | L_RIGHT | L_LEFT)
char layer_state_str[24]; char layer_state_str[24];
@ -15,15 +15,15 @@ const char *read_layer_state(void) {
case L_BASE: case L_BASE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Base"); snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Base");
break; break;
case L_RAISE: case L_RIGHT:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Right");
break; break;
case L_LOWER: case L_LEFT:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Left");
break; break;
case L_ADJUST: case L_MIDDLE:
case L_ADJUST_TRI: case L_MIDDLE_TRI:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Middle");
break; break;
default: default:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%u", layer_state); snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%u", layer_state);