1
0
Fork 0

Improve layout

This commit is contained in:
Cat /dev/Nulo 2022-02-22 12:15:09 -03:00
parent 76f68a57e0
commit b9ea8ef91e

View file

@ -18,34 +18,35 @@ enum keycodes {
OS_CTRL,
OS_ALT,
OS_CMD,
OS_RALT,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[DEF] = LAYOUT(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX,XXXXXXX,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,
XXXXXXX,XXXXXXX,XXXXXXX,LA_NAV, KC_BSPC,XXXXXXX,XXXXXXX,KC_SPC, LA_SYM, XXXXXXX,XXXXXXX,XXXXXXX
KC_Z, KC_X, KC_C, KC_V, KC_B, XXXXXXX,XXXXXXX,KC_N, KC_M, KC_COMM,KC_DOT, KC_QUOT,
XXXXXXX,XXXXXXX,XXXXXXX,LA_NAV, KC_LSFT,XXXXXXX,XXXXXXX,KC_SPC, LA_SYM, XXXXXXX,XXXXXXX,XXXXXXX
),
[SYM] = LAYOUT(
KC_ESC, KC_LBRC,KC_LCBR,KC_LPRN,KC_TILD, KC_CIRC,KC_RPRN,KC_RCBR,KC_RBRC,KC_GRV,
KC_MINS,KC_ASTR,KC_EQL, KC_UNDS,KC_DLR, KC_HASH,OS_CMD, OS_ALT, OS_CTRL,OS_SHFT,
KC_PLUS,KC_PIPE,KC_AT, KC_SLSH,KC_PERC,XXXXXXX,XXXXXXX,XXXXXXX,KC_BSLS,KC_AMPR,KC_QUES,KC_EXLM,
KC_MINS,KC_ASTR,KC_EQL, KC_UNDS,KC_DLR, KC_HASH,OS_CMD, OS_CTRL,OS_ALT, OS_SHFT,
KC_PLUS,KC_PIPE,KC_AT, KC_SLSH,KC_PERC,XXXXXXX,XXXXXXX,KC_AMPR,KC_BSLS,OS_RALT,KC_QUES,KC_EXLM,
XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX
),
[NAV] = LAYOUT(
KC_TAB, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, RESET, KC_CAPS,XXXXXXX,XXXXXXX,RESET,
OS_SHFT,OS_CTRL,OS_ALT, OS_CMD, XXXXXXX, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_BSPC,
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,KC_ENT,
KC_TAB, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, RESET, KC_CAPS,XXXXXXX,XXXXXXX,XXXXXXX,
OS_SHFT,OS_ALT, OS_CTRL,OS_CMD, XXXXXXX, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_BSPC,
XXXXXXX,XXXXXXX,OS_RALT,XXXXXXX,KC_PSCR,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,KC_ENT,
XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX
),
[NUM] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
OS_SHFT,OS_CTRL,OS_ALT, OS_CMD, KC_F11, KC_F12, OS_CMD, OS_ALT, OS_CTRL,OS_SHFT,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______,_______,KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
OS_SHFT,OS_ALT, OS_CTRL,OS_CMD, KC_F11, KC_F12, OS_CMD, OS_CTRL,OS_ALT, OS_SHFT,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX,XXXXXXX,KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
XXXXXXX,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX
)
};
@ -68,6 +69,7 @@ bool is_oneshot_ignored_key(uint16_t keycode) {
case OS_SHFT:
case OS_CTRL:
case OS_ALT:
case OS_RALT:
case OS_CMD:
return true;
default:
@ -79,6 +81,7 @@ oneshot_state os_shft_state = os_up_unqueued;
oneshot_state os_ctrl_state = os_up_unqueued;
oneshot_state os_alt_state = os_up_unqueued;
oneshot_state os_cmd_state = os_up_unqueued;
oneshot_state os_ralt_state = os_up_unqueued;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_oneshot(
@ -97,6 +100,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
&os_cmd_state, KC_LCMD, OS_CMD,
keycode, record
);
update_oneshot(
&os_ralt_state, KC_RALT, OS_RALT,
keycode, record
);
return true;
}