2021-10-11 11:55:20 +02:00
|
|
|
/* Copyright 2021 @daliusd
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
#include QMK_KEYBOARD_H
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
#include "flow.h"
|
2021-10-11 11:55:20 +02:00
|
|
|
|
|
|
|
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
|
|
|
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
|
|
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
|
|
// entirely and just use numbers.
|
|
|
|
enum layers {
|
|
|
|
_QWERTY,
|
|
|
|
_SYM,
|
|
|
|
_NAV,
|
2022-10-25 08:23:35 +02:00
|
|
|
_MISC,
|
2021-10-11 11:55:20 +02:00
|
|
|
_TMUX,
|
|
|
|
_MOUSE,
|
|
|
|
_FUNC,
|
2022-10-25 08:23:35 +02:00
|
|
|
_LT_MAC,
|
|
|
|
_LT_LINUX,
|
2021-10-11 11:55:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum custom_keycodes {
|
|
|
|
TM_NEXT = SAFE_RANGE,
|
|
|
|
TM_PREV,
|
|
|
|
TM_LEFT,
|
|
|
|
TM_RIGHT,
|
|
|
|
TM_NEW,
|
|
|
|
TM_SLCT,
|
|
|
|
TM_SRCH,
|
|
|
|
TM_URL,
|
|
|
|
OS_MISC,
|
2022-10-25 08:23:35 +02:00
|
|
|
OS_TMUX,
|
2021-10-11 11:55:20 +02:00
|
|
|
OS_FUNC,
|
2022-10-25 08:23:35 +02:00
|
|
|
LT_OSLNX,
|
2021-10-11 11:55:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Shortcut to make keymap more readable
|
|
|
|
|
|
|
|
#define L_NAV MO(_NAV)
|
|
|
|
#define L_SYM MO(_SYM)
|
2022-10-25 08:23:35 +02:00
|
|
|
#define L_MOUSE MO(_MOUSE)
|
2021-10-11 11:55:20 +02:00
|
|
|
|
|
|
|
#define K_PRINT (QK_LCTL | QK_LSFT | QK_LGUI | KC_4)
|
2022-10-25 08:23:35 +02:00
|
|
|
#define K_VIDEO (QK_LSFT | QK_LGUI | KC_5)
|
|
|
|
|
|
|
|
// flow_config should correspond to following format:
|
|
|
|
// * layer keycode
|
|
|
|
// * modifier keycode
|
|
|
|
const uint16_t flow_config[FLOW_COUNT][2] = {
|
|
|
|
{L_NAV, KC_LALT},
|
|
|
|
{L_NAV, KC_LGUI},
|
|
|
|
{L_NAV, KC_LCTL},
|
|
|
|
{L_SYM, KC_RCTL},
|
|
|
|
{L_SYM, KC_RGUI},
|
|
|
|
{L_SYM, KC_RALT},
|
|
|
|
};
|
2021-10-11 11:55:20 +02:00
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
const uint16_t flow_layers_config[FLOW_LAYERS_COUNT][2] = {
|
|
|
|
{OS_MISC, _MISC},
|
|
|
|
{OS_TMUX, _TMUX},
|
|
|
|
{OS_FUNC, _FUNC},
|
|
|
|
};
|
|
|
|
|
|
|
|
// Unicode characters
|
2021-10-11 11:55:20 +02:00
|
|
|
enum unicode_names {
|
|
|
|
SNEK,
|
|
|
|
EURO,
|
|
|
|
LT_S_A,
|
|
|
|
LT_L_A,
|
|
|
|
LT_S_C,
|
|
|
|
LT_L_C,
|
|
|
|
LT_S_E1,
|
|
|
|
LT_L_E1,
|
|
|
|
LT_S_E2,
|
|
|
|
LT_L_E2,
|
|
|
|
LT_S_I,
|
|
|
|
LT_L_I,
|
|
|
|
LT_S_S,
|
|
|
|
LT_L_S,
|
|
|
|
LT_S_U1,
|
|
|
|
LT_L_U1,
|
|
|
|
LT_S_U2,
|
|
|
|
LT_L_U2,
|
|
|
|
LT_S_Z,
|
|
|
|
LT_L_Z,
|
|
|
|
LT_OB,
|
|
|
|
LT_CB,
|
|
|
|
};
|
|
|
|
|
2023-01-01 01:54:12 +01:00
|
|
|
const uint32_t unicode_map[] PROGMEM = {
|
2021-10-11 11:55:20 +02:00
|
|
|
[SNEK] = 0x1F40D, // 🐍
|
|
|
|
[EURO] = 0x20ac, // €
|
|
|
|
[LT_S_A] = 0x105, // ą
|
|
|
|
[LT_L_A] = 0x104, // Ą
|
|
|
|
[LT_S_C] = 0x10d, // č
|
|
|
|
[LT_L_C] = 0x10c, // Č
|
|
|
|
[LT_S_E1] = 0x119, // ę
|
|
|
|
[LT_L_E1] = 0x118, // Ę
|
|
|
|
[LT_S_E2] = 0x117, // ė
|
|
|
|
[LT_L_E2] = 0x116, // Ė
|
|
|
|
[LT_S_I] = 0x12f, // į
|
|
|
|
[LT_L_I] = 0x12e, // Į
|
|
|
|
[LT_S_S] = 0x161, // š
|
2022-10-25 08:23:35 +02:00
|
|
|
[LT_L_S] = 0x160, // Š
|
2021-10-11 11:55:20 +02:00
|
|
|
[LT_S_U1] = 0x173, // ų
|
|
|
|
[LT_L_U1] = 0x172, // Ų
|
|
|
|
[LT_S_U2] = 0x16b, // ū
|
|
|
|
[LT_L_U2] = 0x16a, // Ū
|
|
|
|
[LT_S_Z] = 0x17e, // ž
|
|
|
|
[LT_L_Z] = 0x17d, // Ž
|
|
|
|
[LT_OB] = 0x201e, // „
|
|
|
|
[LT_CB] = 0x201c, // “
|
|
|
|
};
|
|
|
|
|
2023-06-01 18:25:08 +02:00
|
|
|
#define K_SNEK UM(SNEK)
|
|
|
|
#define K_EURO UM(EURO)
|
|
|
|
#define K_LT_A UP(LT_S_A, LT_L_A)
|
|
|
|
#define K_LT_AU UM(LT_L_A)
|
|
|
|
#define K_LT_C UP(LT_S_C, LT_L_C)
|
|
|
|
#define K_LT_CU UM(LT_L_C)
|
|
|
|
#define K_LT_E1 UP(LT_S_E1, LT_L_E1)
|
|
|
|
#define K_LT_E1U UM(LT_L_E1)
|
|
|
|
#define K_LT_E2 UP(LT_S_E2, LT_L_E2)
|
|
|
|
#define K_LT_E2U UM(LT_L_E2)
|
|
|
|
#define K_LT_I UP(LT_S_I, LT_L_I)
|
|
|
|
#define K_LT_IU UM(LT_L_I)
|
|
|
|
#define K_LT_S UP(LT_S_S, LT_L_S)
|
|
|
|
#define K_LT_SU UM(LT_L_S)
|
|
|
|
#define K_LT_U1 UP(LT_S_U1, LT_L_U1)
|
|
|
|
#define K_LT_U1U UM(LT_L_U1)
|
|
|
|
#define K_LT_U2 UP(LT_S_U2, LT_L_U2)
|
|
|
|
#define K_LT_U2U UM(LT_L_U2)
|
|
|
|
#define K_LT_Z UP(LT_S_Z, LT_L_Z)
|
|
|
|
#define K_LT_ZU UM(LT_L_Z)
|
|
|
|
#define K_LT_OB UM(LT_OB)
|
|
|
|
#define K_LT_CB UM(LT_CB)
|
2021-10-11 11:55:20 +02:00
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
[_QWERTY] = 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 , KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH,
|
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
|
|
|
L_NAV , KC_SPC , KC_LSFT , L_SYM
|
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
|
|
|
[_SYM] = LAYOUT(
|
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
|
|
|
KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_LPRN ,KC_RPRN ,
|
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,KC_GRV ,KC_LBRC ,KC_RBRC ,KC_PLUS , KC_MINS ,KC_PIPE ,KC_RCTL ,KC_RGUI ,KC_RALT ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_DEL ,KC_BSPC ,KC_LCBR ,KC_RCBR ,KC_EQL , KC_UNDS ,KC_QUOT ,KC_DQT ,OS_MISC ,KC_BSLS ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
2022-10-25 08:23:35 +02:00
|
|
|
_______ , _______ , _______ , XXXXXXX
|
2021-10-11 11:55:20 +02:00
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
|
|
|
[_NAV] = LAYOUT(
|
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_LALT ,KC_LGUI ,KC_LCTL ,KC_TAB ,KC_ENT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,KC_PGUP ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_LSFT ,KC_BSPC ,KC_ESC ,KC_TILDE,OS_TMUX , OS_FUNC ,L_MOUSE ,KC_COMM ,KC_DOT ,KC_PGDN ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX , _______ , _______ , _______
|
2021-10-11 11:55:20 +02:00
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
[_MISC] = LAYOUT(
|
2021-10-11 11:55:20 +02:00
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
2022-11-15 17:52:01 +01:00
|
|
|
QK_BOOT ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BRID ,KC_BRIU ,KC_PSCR ,XXXXXXX ,K_PRINT ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-11-15 17:52:01 +01:00
|
|
|
XXXXXXX ,XXXXXXX ,DB_TOGG ,LT_OSLNX,XXXXXXX , KC_MPRV ,KC_MPLY ,KC_MNXT ,XXXXXXX ,K_VIDEO ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_VOLD ,KC_VOLU ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
|
2021-10-11 11:55:20 +02:00
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
|
|
|
[_TMUX] = LAYOUT(
|
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
|
|
|
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,TM_URL ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
|
|
|
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_LEFT ,TM_NEXT ,TM_PREV ,TM_RIGHT,XXXXXXX ,
|
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
|
|
|
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , TM_NEW ,TM_SLCT ,XXXXXXX ,XXXXXXX ,TM_SRCH ,
|
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
|
|
|
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
|
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
|
|
|
[_MOUSE] = LAYOUT(
|
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,XXXXXXX ,KC_MS_U ,KC_BTN3 ,KC_WH_U , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D , XXXXXXX ,XXXXXXX ,KC_RCTL ,KC_RGUI ,KC_RALT ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_BTN1 , KC_BTN2 , _______ , XXXXXXX
|
2021-10-11 11:55:20 +02:00
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
[_FUNC] = LAYOUT(
|
2021-10-11 11:55:20 +02:00
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 , XXXXXXX ,XXXXXXX ,KC_RCTL ,KC_RGUI ,KC_RALT ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_F11 ,KC_F12 ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
|
|
|
XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX
|
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
[_LT_MAC] = LAYOUT(
|
2021-10-11 11:55:20 +02:00
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC , KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_PLUS ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_EQL ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX ,KC_BSPC ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
2021-10-11 11:55:20 +02:00
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
2022-10-25 08:23:35 +02:00
|
|
|
XXXXXXX , XXXXXXX , _______ , XXXXXXX
|
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
|
|
|
|
[_LT_LINUX] = LAYOUT(
|
|
|
|
//┌────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┐
|
|
|
|
K_LT_AU ,K_LT_CU ,K_LT_E1U,K_LT_E2U,K_LT_IU , K_LT_SU ,K_LT_U1U,K_LT_U2U,K_LT_ZU ,XXXXXXX ,
|
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
|
|
|
K_LT_A ,K_LT_C ,K_LT_E1 ,K_LT_E2 ,K_LT_I , K_LT_S ,K_LT_U1 ,K_LT_U2 ,K_LT_Z ,XXXXXXX ,
|
|
|
|
//├────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┤
|
|
|
|
XXXXXXX ,KC_BSPC ,XXXXXXX ,K_SNEK ,K_LT_OB , K_LT_CB ,K_EURO ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
|
|
|
//└────────┴────────┴────────┴────┬───┴────┬───┼────────┐ ┌────────┼───┬────┴───┬────┴────────┴────────┴────────┘
|
|
|
|
XXXXXXX , XXXXXXX , _______ , XXXXXXX
|
2021-10-11 11:55:20 +02:00
|
|
|
// └────────┘ └────────┘ └────────┘ └────────┘
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TMUX_PREFIX SS_DOWN(X_LCTL) "b" SS_UP(X_LCTL)
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
bool lt_os_is_linux = false;
|
2021-10-11 11:55:20 +02:00
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
2022-10-25 08:23:35 +02:00
|
|
|
if (!update_flow(keycode, record->event.pressed, record->event.key)) return false;
|
2021-10-11 11:55:20 +02:00
|
|
|
|
|
|
|
switch (keycode) {
|
|
|
|
case TM_LEFT:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "<");
|
|
|
|
return false;
|
|
|
|
case TM_RIGHT:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX ">");
|
|
|
|
return false;
|
|
|
|
case TM_NEXT:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "n");
|
|
|
|
return false;
|
|
|
|
case TM_PREV:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "p");
|
|
|
|
return false;
|
|
|
|
case TM_NEW:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "c");
|
|
|
|
return false;
|
|
|
|
case TM_SLCT:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "[");
|
|
|
|
return false;
|
|
|
|
case TM_SRCH:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX "\t");
|
|
|
|
return false;
|
|
|
|
case TM_URL:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
SEND_STRING(TMUX_PREFIX SS_LCTL("u"));
|
|
|
|
return false;
|
2022-10-25 08:23:35 +02:00
|
|
|
case LT_OSLNX:
|
|
|
|
if (!record->event.pressed) return true;
|
|
|
|
lt_os_is_linux = !lt_os_is_linux;
|
|
|
|
return false;
|
2021-10-11 11:55:20 +02:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-10-25 08:23:35 +02:00
|
|
|
void matrix_scan_user(void) {
|
|
|
|
flow_matrix_scan();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool lang_layer_on = false;
|
|
|
|
|
2021-10-11 11:55:20 +02:00
|
|
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
2022-10-25 08:23:35 +02:00
|
|
|
state = update_tri_layer_state(state, _SYM, _NAV, lt_os_is_linux ? _LT_LINUX : _LT_MAC);
|
|
|
|
|
|
|
|
uint8_t hl = get_highest_layer(state);
|
|
|
|
if (hl == _LT_MAC) {
|
|
|
|
if (!lang_layer_on) {
|
|
|
|
tap_code16(LCTL(KC_SPC));
|
|
|
|
lang_layer_on = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (lang_layer_on) {
|
|
|
|
tap_code16(LCTL(KC_SPC));
|
|
|
|
lang_layer_on = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
2021-10-11 11:55:20 +02:00
|
|
|
}
|