Sofle: Remove LAYOUT_kc macro for default layout. Remove unnecessary code.

master
Josef Adamcik 2020-04-29 17:11:16 +02:00
parent 168ba88ada
commit 41fd60d624
3 changed files with 64 additions and 92 deletions

View File

@ -6,8 +6,7 @@ enum sofle_layers {
_W_QWERTY, _W_QWERTY,
_M_COLEMAK, _M_COLEMAK,
_W_COLEMAK, _W_COLEMAK,
_M_LOWER, _LOWER,
_W_LOWER,
_M_RAISE, _M_RAISE,
_W_RAISE, _W_RAISE,
_ADJUST, _ADJUST,
@ -47,9 +46,8 @@ enum custom_keycodes {
#define KC_M_LEND LGUI(KC_RIGHT) #define KC_M_LEND LGUI(KC_RIGHT)
#define KC_M_DLINE LGUI(KC_BSPC) #define KC_M_DLINE LGUI(KC_BSPC)
#define KC_____ KC_TRNS #define ______ KC_TRNS
#define KC_XXXX KC_NO #define XXXXXX KC_NO
#define KC_RESET RESET
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
@ -67,19 +65,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | |/ / \ \ | | | | | * | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------' * `----------------------------------' '------''---------------------------'
*/ */
[_M_QWERTY] = LAYOUT_kc( \ [_M_QWERTY] = LAYOUT( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, GRV, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \
ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, \ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
LSFT, Z, X, C, V, B, MUTE, XXXX, N, M, COMM, DOT, SLSH, RSFT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
LCTRL,LALT,LGUI,M_LOWER, ENT, SPC, M_RAISE, RGUI, RALT, RCTRL \ KC_LCTRL,KC_LALT,KC_LGUI,KC_M_LOWER, KC_ENT, KC_SPC, KC_M_RAISE, KC_RGUI, KC_RALT, KC_RCTRL \
), ),
[_W_QWERTY] = LAYOUT_kc( \ [_W_QWERTY] = LAYOUT( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, GRV, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \
ESC, Q, W, E, R, T, Y, U, I, O, P, BSPC, \ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
TAB, A, S, D, F, G, H, J, K, L, SCLN, QUOT, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
LSFT, Z, X, C, V, B, MUTE, XXXX, N, M, COMM, DOT, SLSH, RSFT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
LGUI, LALT,LCTRL,W_LOWER,ENT, SPC, W_RAISE, RCTRL,RALT, RGUI \ KC_LGUI,KC_LALT,KC_LCTRL,KC_M_LOWER, KC_ENT, KC_SPC, KC_M_RAISE, KC_RCTRL, KC_RALT, KC_RGUI \
), ),
/* /*
* COLEMAK * COLEMAK
@ -97,19 +95,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------' '------''---------------------------' * `----------------------------------' '------''---------------------------'
*/ */
[_M_COLEMAK] = LAYOUT_kc( \ [_M_COLEMAK] = LAYOUT( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, GRV, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \
ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSPC, \ KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
TAB, A, R, S, T, D, H, N, E, I, O, QUOT, \ KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
LSFT, Z, X, C, V, B, MUTE, XXXX, K, M, COMM, DOT, SLSH, RSFT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
LCTRL,LALT,LGUI,M_LOWER, ENT, SPC, M_RAISE, RGUI, RALT, RCTRL \ KC_LCTRL,KC_LALT,KC_LGUI,KC_M_LOWER, KC_ENT, KC_SPC, KC_M_RAISE, KC_RGUI, KC_RALT, KC_RCTRL \
), ),
[_W_COLEMAK] = LAYOUT_kc( \ [_W_COLEMAK] = LAYOUT( \
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, GRV, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \
ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSPC, \ KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
TAB, A, R, S, T, D, H, N, E, I, O, QUOT, \ KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
LSFT, Z, X, C, V, B, MUTE, XXXX, K, M, COMM, DOT, SLSH, RSFT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
LGUI, LALT,LCTRL,W_LOWER,ENT, SPC, W_RAISE, RCTRL,RALT, RGUI \ KC_LGUI,KC_LALT,KC_LCTRL,KC_M_LOWER, KC_ENT, KC_SPC, KC_M_RAISE, KC_RCTRL, KC_RALT, KC_RGUI \
), ),
/* LOWER /* LOWER
* ,-----------------------------------------. ,-----------------------------------------. * ,-----------------------------------------. ,-----------------------------------------.
@ -125,19 +123,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | |/ / \ \ | | | | | * | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------' * `----------------------------------' '------''---------------------------'
*/ */
[_M_LOWER] = LAYOUT_kc( \ [_LOWER] = LAYOUT( \
____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,\ ______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,\
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12, \
____, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, PIPE, \ ______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \
____, EQL, MINS, PLUS, LCBR, RCBR, ____, ____, LBRC, RBRC, SCLN, COLN, BSLS, ____, \ ______, KC_EQL, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, ______, ______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, KC_BSLS, ______, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____\ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______\
),
[_W_LOWER] = LAYOUT_kc( \
____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,\
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \
____, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, PIPE, \
____, EQL, MINS, PLUS, LCBR, RCBR, ____, ____, LBRC, RBRC, SCLN, COLN, BSLS, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____\
), ),
/* RAISE /* RAISE
* ,----------------------------------------. ,-----------------------------------------. * ,----------------------------------------. ,-----------------------------------------.
@ -153,19 +144,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | |/ / \ \ | | | | | * | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------' * `----------------------------------' '------''---------------------------'
*/ */
[_M_RAISE] = LAYOUT_kc( \ [_M_RAISE] = LAYOUT( \
____, ____ , ____ , ____ , ____ , ____, ____, ____ , ____, ____ , ____ ,____, \ ______, ______ , ______ , ______ , ______ , ______, ______, ______ , ______, ______ , ______ ,______, \
____, INS, PSCR, APP, XXXX, XXXX, PGUP, M_PRVWD, UP,M_NXTWD,M_DLINE,BSPC, \ ______, KC_INS, KC_PSCR, KC_APP, XXXXXX, XXXXXX, KC_PGUP, KC_M_PRVWD, KC_UP,KC_M_NXTWD,KC_M_DLINE,KC_BSPC, \
____, LALT, LCTL, LSFT, XXXX, CAPS, PGDN, LEFT, DOWN, RGHT, DEL, BSPC, \ ______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, \
____,M_UNDO, M_CUT,M_COPY,M_PASTE,XXXX, ____, ____, XXXX, M_LSTRT, XXXX, M_LEND, XXXX, ____, \ ______,KC_M_UNDO, KC_M_CUT,KC_M_COPY,KC_M_PASTE, XXXXXX,______, ______, XXXXXX, KC_M_LSTRT, XXXXXX, KC_M_LEND, XXXXXX, ______, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____ \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
), ),
[_W_RAISE] = LAYOUT_kc( \ [_W_RAISE] = LAYOUT( \
____, ____ , ____ , ____ , ____ , ____, ____, ____ , ____, ____ , ____ , ____, \ ______, ______ , ______ , ______ , ______ , ______, ______, ______ , ______, ______ , ______ ,______, \
____, INS, PSCR, APP, XXXX, XXXX, PGUP, W_PRVWD, UP,W_NXTWD,W_DLINE, BSPC, \ ______, KC_INS, KC_PSCR, KC_APP, XXXXXX, XXXXXX, KC_PGUP, KC_W_PRVWD, KC_UP,KC_W_NXTWD,KC_W_DLINE, KC_BSPC, \
____, LALT, LCTL, LSFT, XXXX, CAPS, PGDN, LEFT, DOWN, RGHT, DEL, BSPC, \ ______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, \
____,W_UNDO, W_CUT,W_COPY,W_PASTE,XXXX, ____, ____, XXXX, W_LSTRT, XXXX, W_LEND, XXXX, ____, \ ______,KC_W_UNDO,KC_W_CUT,KC_W_COPY,KC_W_PASTE,XXXXXX, ______, ______, XXXXXX, KC_W_LSTRT, XXXXXX, KC_W_LEND, XXXXXX, ______, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____ \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
), ),
/* ADJUST /* ADJUST
* ,-----------------------------------------. ,-----------------------------------------. * ,-----------------------------------------. ,-----------------------------------------.
@ -181,12 +172,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | |/ / \ \ | | | | | * | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------' * `----------------------------------' '------''---------------------------'
*/ */
[_ADJUST] = LAYOUT_kc( \ [_ADJUST] = LAYOUT( \
XXXX , XXXX, XXXX , XXXX , XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ XXXXXX , XXXXXX, XXXXXX , XXXXXX , XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
RESET, XXXX,M_QWERTY,M_COLEMAK, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ RESET , XXXXXX,KC_M_QWERTY,KC_M_COLEMAK,XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \
XXXX , XXXX,W_QWERTY,W_COLEMAK, XXXX, XXXX, XXXX, VOLD, MUTE, VOLU, XXXX, XXXX, \ XXXXXX , XXXXXX,KC_W_QWERTY,KC_W_COLEMAK,XXXXXX, XXXXXX, XXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXX, XXXXXX, \
XXXX , XXXX, XXXX , XXXX , XXXX, XXXX, XXXX, XXXX, XXXX, MPRV, MPLY, MNXT, XXXX, XXXX, \ XXXXXX , XXXXXX, XXXXXX , XXXXXX , XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXX, XXXXXX, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____ \ ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \
) )
}; };
@ -237,8 +228,7 @@ static void print_status_narrow(void) {
case _W_RAISE: case _W_RAISE:
oled_write_P(PSTR("Raise"), false); oled_write_P(PSTR("Raise"), false);
break; break;
case _M_LOWER: case _LOWER:
case _W_LOWER:
oled_write_P(PSTR("Lower"), false); oled_write_P(PSTR("Lower"), false);
break; break;
case _ADJUST: case _ADJUST:
@ -297,41 +287,41 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
case KC_M_LOWER: case KC_M_LOWER:
if (record->event.pressed) { if (record->event.pressed) {
layer_on(_M_LOWER); layer_on(_LOWER);
update_tri_layer(_M_LOWER, _M_RAISE, _ADJUST); update_tri_layer(_LOWER, _M_RAISE, _ADJUST);
} else { } else {
layer_off(_M_LOWER); layer_off(_LOWER);
update_tri_layer(_M_LOWER, _M_RAISE, _ADJUST); update_tri_layer(_LOWER, _M_RAISE, _ADJUST);
} }
return false; return false;
break; break;
case KC_M_RAISE: case KC_M_RAISE:
if (record->event.pressed) { if (record->event.pressed) {
layer_on(_M_RAISE); layer_on(_M_RAISE);
update_tri_layer(_M_LOWER, _M_RAISE, _ADJUST); update_tri_layer(_LOWER, _M_RAISE, _ADJUST);
} else { } else {
layer_off(_M_RAISE); layer_off(_M_RAISE);
update_tri_layer(_M_LOWER, _M_RAISE, _ADJUST); update_tri_layer(_LOWER, _M_RAISE, _ADJUST);
} }
return false; return false;
break; break;
case KC_W_LOWER: case KC_W_LOWER:
if (record->event.pressed) { if (record->event.pressed) {
layer_on(_W_LOWER); layer_on(_LOWER);
update_tri_layer(_W_LOWER, _W_RAISE, _ADJUST); update_tri_layer(_LOWER, _W_RAISE, _ADJUST);
} else { } else {
layer_off(_W_LOWER); layer_off(_LOWER);
update_tri_layer(_W_LOWER, _W_RAISE, _ADJUST); update_tri_layer(_LOWER, _W_RAISE, _ADJUST);
} }
return false; return false;
break; break;
case KC_W_RAISE: case KC_W_RAISE:
if (record->event.pressed) { if (record->event.pressed) {
layer_on(_W_RAISE); layer_on(_W_RAISE);
update_tri_layer(_W_LOWER, _W_RAISE, _ADJUST); update_tri_layer(_LOWER, _W_RAISE, _ADJUST);
} else { } else {
layer_off(_W_RAISE); layer_off(_W_RAISE);
update_tri_layer(_W_LOWER, _W_RAISE, _ADJUST); update_tri_layer(_LOWER, _W_RAISE, _ADJUST);
} }
return false; return false;
break; break;

View File

@ -21,17 +21,3 @@
{ R45, R44, R43, R42, R41, R40 } \ { R45, R44, R43, R42, R41, R40 } \
} }
#define LAYOUT_kc( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, \
L40, L41, L42, L43, L44, R41, R42, R43, R44, R45 \
) \
LAYOUT( \
KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \
KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \
KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L45, KC_##R40, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 , \
KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \
)

View File

@ -1,5 +1 @@
#include "sofle.h" #include "sofle.h"
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record);
}