2023-01-16 23:02:14 +08:00
|
|
|
/* Copyright 2022 @ sajenim (https://github.com/sajenim)
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
#include QMK_KEYBOARD_H
|
2023-02-03 22:03:06 +08:00
|
|
|
#include <stdio.h>
|
2023-01-16 23:02:14 +08:00
|
|
|
#include "config.h"
|
2023-02-19 17:51:22 +08:00
|
|
|
#include "layers.h"
|
|
|
|
#include "process_record.h"
|
|
|
|
#include "g/keymap_combo.h"
|
2023-02-03 22:03:06 +08:00
|
|
|
|
|
|
|
/* Keymaps */
|
|
|
|
|
2023-01-06 02:03:52 +08:00
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_CANARY] = LAYOUT_split_3x6_3(
|
2023-01-06 02:03:52 +08:00
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-19 17:51:22 +08:00
|
|
|
KC_GRV, KC_W, KC_L, KC_Y, KC_P, KC_B, KC_Z, KC_F, KC_O, KC_U, KC_QUOT, XXXXXXX,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
BAKWORD, HOME_C, HOME_R, HOME_S, HOME_T, KC_G, KC_M, HOME_N, HOME_E, HOME_I, HOME_A, DELWORD,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
XXXXXXX, KC_Q, KC_J, KC_V, KC_D, KC_K, KC_X, KC_H, KC_SLSH, KC_COMM, KC_DOT, XXXXXXX,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
LOWER, FN_PFX, FN_SPC, FN_ENT, FN_LDR, RAISE
|
2023-01-06 02:03:52 +08:00
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
|
|
|
|
),
|
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_NAVIGATION] = LAYOUT_split_3x6_3(
|
2023-01-06 02:03:52 +08:00
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-19 17:51:22 +08:00
|
|
|
_______, XXXXXXX, XXXXXXX, KC_PGUP, KC_PGDN, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, XXXXXXX, _______,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-01-16 23:02:14 +08:00
|
|
|
_______, OS_LGUI, OS_LALT, OS_LSFT, OS_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
2023-02-03 22:03:06 +08:00
|
|
|
_______, _______, _______, KC_TAB, _______, _______
|
2023-01-06 02:03:52 +08:00
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_SYMBOLS] = LAYOUT_split_3x6_3(
|
2023-01-06 02:03:52 +08:00
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-03 22:03:06 +08:00
|
|
|
XXXXXXX, XXXXXXX, KC_LABK, KC_DLR, KC_RABK, XXXXXXX, XXXXXXX, KC_LBRC, KC_UNDS, KC_RBRC, XXXXXXX, XXXXXXX,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-01-16 23:02:14 +08:00
|
|
|
KC_MINS, KC_BSLS, KC_LPRN, KC_DQUO, KC_RPRN, KC_HASH, KC_PERC, KC_LCBR, KC_EQL, KC_RCBR, KC_PIPE, KC_SCLN,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-01-16 23:02:14 +08:00
|
|
|
XXXXXXX, XXXXXXX, KC_COLN, KC_ASTR, KC_PLUS, XXXXXXX, XXXXXXX, KC_AMPR, KC_CIRC, KC_TILD, XXXXXXX, XXXXXXX,
|
2023-01-06 02:03:52 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
2023-01-16 23:02:14 +08:00
|
|
|
_______, _______, _______, _______, _______, _______
|
2023-01-06 02:03:52 +08:00
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_NUMBERS] = LAYOUT_split_3x6_3(
|
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-19 17:51:22 +08:00
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLSH, KC_7, KC_8, KC_9, KC_MINS, _______,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
|
|
|
_______, OS_LGUI, OS_LALT, OS_LSFT, OS_LCTL, XXXXXXX, KC_ASTR, KC_4, KC_5, KC_6, KC_PLUS, _______,
|
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DOT, KC_1, KC_2, KC_3, KC_EQL, _______,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
_______, _______, _______, _______, KC_0, _______
|
2023-01-16 23:02:14 +08:00
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_MACRO] = LAYOUT_split_3x6_3(
|
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-19 17:51:22 +08:00
|
|
|
HOME, XXXXXXX, XXXXXXX, YANK, PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UPDIR,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-19 17:51:22 +08:00
|
|
|
XXXXXXX, XXXXXXX, XXXXXXX, VI_SAVE, VI_EXIT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
|
|
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
2023-02-03 22:03:06 +08:00
|
|
|
_______, _______, ST_PSTE, _______, _______, _______
|
2023-01-16 23:02:14 +08:00
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_LOWER] = LAYOUT_split_3x6_3(
|
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
|
|
|
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,
|
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
|
|
|
_______, _______, _______, _______, _______, _______
|
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_RAISE] = LAYOUT_split_3x6_3(
|
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
|
|
|
KC_MUTE, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_MSEL, KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, KC_SLEP,
|
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
|
|
|
KC_VOLU, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_WHOM, KC_WREF, KC_WSTP, KC_WBAK, KC_WFWD, KC_BRIU,
|
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
|
|
|
KC_VOLD, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID,
|
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
|
|
|
_______, _______, _______, _______, _______, _______
|
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
[L_ADJUST] = LAYOUT_split_3x6_3(
|
|
|
|
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
2023-02-03 22:03:06 +08:00
|
|
|
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AS_TOGG,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-03 22:03:06 +08:00
|
|
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AC_TOGG,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
2023-02-03 22:03:06 +08:00
|
|
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, CM_TOGG,
|
2023-01-16 23:02:14 +08:00
|
|
|
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
|
|
|
_______, _______, _______, _______, _______, _______
|
|
|
|
//`--------------------------' `--------------------------'
|
|
|
|
),
|
|
|
|
};
|
2023-01-06 02:03:52 +08:00
|
|
|
|
2023-02-03 22:03:06 +08:00
|
|
|
|
|
|
|
/* Add Home Row Mods to Auto Shift */
|
|
|
|
|
|
|
|
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch(keycode) {
|
|
|
|
// Left hand home-row mods
|
|
|
|
case HOME_C:
|
|
|
|
return true;
|
|
|
|
case HOME_R:
|
|
|
|
return true;
|
|
|
|
case HOME_S:
|
|
|
|
return true;
|
|
|
|
case HOME_T:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
// Right hand home-row mods
|
|
|
|
case HOME_N:
|
|
|
|
return true;
|
|
|
|
case HOME_E:
|
|
|
|
return true;
|
|
|
|
case HOME_I:
|
|
|
|
return true;
|
|
|
|
case HOME_A:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-02-19 17:51:22 +08:00
|
|
|
/* Configure which words are word breaking */
|
|
|
|
bool caps_word_press_user(uint16_t keycode) {
|
|
|
|
switch (keycode) {
|
|
|
|
// Keycodes that continue Caps Word, with shift applied.
|
|
|
|
case KC_A ... KC_Z:
|
|
|
|
case KC_MINS:
|
|
|
|
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
|
|
|
|
return true;
|
|
|
|
|
|
|
|
// Keycodes that continue Caps Word, without shifting.
|
|
|
|
case KC_1 ... KC_0:
|
|
|
|
case KC_BSPC:
|
|
|
|
case KC_DEL:
|
|
|
|
case KC_UNDS:
|
|
|
|
// Our custom keys
|
|
|
|
case BAKWORD:
|
|
|
|
case DELWORD:
|
|
|
|
return true;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return false; // Deactivate Caps Word.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-02-03 22:03:06 +08:00
|
|
|
/* Layer Change */
|
|
|
|
|
2023-01-16 23:02:14 +08:00
|
|
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
2023-02-04 20:40:25 +08:00
|
|
|
state = update_tri_layer_state(state, L_LOWER, L_RAISE, L_ADJUST);
|
|
|
|
return state;
|
2023-01-06 02:03:52 +08:00
|
|
|
}
|
|
|
|
|
2023-02-03 22:03:06 +08:00
|
|
|
|
|
|
|
/* Post Init */
|
|
|
|
|
|
|
|
void keyboard_post_init_user(void) {
|
|
|
|
autoshift_disable();
|
|
|
|
autocorrect_enable();
|
|
|
|
}
|