Updated layout and some reformatting.

This commit is contained in:
Sheldon Lee 2022-04-12 16:37:40 +08:00
parent 4a55a39a20
commit a2a0c74f87

View File

@ -19,6 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H
#include "oneshot.h"
#define LOCK LGUI(KC_ESC)
#define CTLBSPC LCTL(KC_BSPC)
#define CTLDEL LCTL(KC_DEL)
enum tap_dance{
GUI_ALT
};
@ -32,7 +36,7 @@ enum eycodes {
DL_QWER,
DL_GAME,
OS_GUI,
OS_CTRL,
OS_CTL,
OS_ALT,
OS_SHFT,
};
@ -108,54 +112,56 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[L1] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, _______,
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_GRV, KC_TILD, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, XXXXXXX, MO(FN), XXXXXXX, XXXXXXX
//`--------------------------' `--------------------------'
),
[L2] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_CIRC, KC_AMPR, KC_ASTR, KC_GRV, KC_TILD, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, OS_ALT, OS_CTRL, OS_GUI, OS_SHFT, XXXXXXX, KC_PLUS, KC_RPRN, KC_RCBR, KC_RBRC, KC_EQL, _______,
_______, KC_UNDS, KC_LBRC, KC_LCBR, KC_LPRN,KC_MINUS, KC_PLUS, KC_RPRN, KC_RCBR, KC_RBRC, KC_EQL, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_BSLS, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
XXXXXXX, XXXXXXX, XXXXXXX, MO(FN), OS_CTL, OS_ALT
//`--------------------------' `--------------------------'
),
/*
* Navigation layer.
* Navigation / Numbers layer.
*/
[R1] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, _______,
_______, KC_CAPS, KC_HOME, KC_PGUP, KC_PGDN, KC_END, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, MO(FN), _______, _______, _______
OS_ALT, OS_CTL, MO(FN), XXXXXXX, XXXXXXX, XXXXXXX
//`--------------------------' `--------------------------'
),
/*
* One Shot Modifier layers.
*/
[L2] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, CTLDEL, CTLBSPC, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
LOCK, OS_ALT, OS_CTL, OS_GUI, OS_SHFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, KC_BSPC, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, MO(R1), OS_CTL, OS_ALT
//`--------------------------' `--------------------------'
),
[R2] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |---------+--------+--------+--------+--------+-------|
_______, KC_UNDS, KC_LBRC, KC_LCBR, KC_LPRN,KC_MINUS, XXXXXXX, OS_SHFT, OS_GUI, OS_CTRL, OS_ALT, KC_ENT,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL,
//|--------+--------+--------+--------+--------+--------+ |---------+--------+--------+--------+--------+-------|
LOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OS_SHFT, OS_GUI, OS_CTL, OS_ALT, KC_ENT,
//|--------+--------+--------+--------+--------+--------+ |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
OS_ALT, OS_CTL, MO(L1), _______, _______, _______
//`--------------------------' `--------------------------'
),
@ -165,7 +171,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, DL_COLE, DL_QWER, DL_GAME, XXXXXXX, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, OS_CTRL, OS_ALT, OS_SHFT, XXXXXXX, XXXXXXX,OS_SHFT, OS_ALT, OS_CTRL, XXXXXXX, _______,
_______, XXXXXXX, OS_CTL, OS_ALT, OS_SHFT, XXXXXXX, XXXXXXX,OS_SHFT, OS_ALT, OS_CTL, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
//`--------------------------' `--------------------------'
@ -191,7 +197,7 @@ bool is_oneshot_ignored_key(uint16_t keycode) {
case KC_LSFT:
case KC_RSFT:
case OS_SHFT:
case OS_CTRL:
case OS_CTL:
case OS_ALT:
case OS_GUI:
return true;
@ -215,7 +221,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
keycode, record
);
update_oneshot(
&os_ctrl_state, KC_LCTL, OS_CTRL,
&os_ctrl_state, KC_LCTL, OS_CTL,
keycode, record
);
update_oneshot(