Работает раскладка на коммите виала 159c088

This commit is contained in:
urec56 2024-12-25 20:24:33 +03:00
commit 8f79457e95
42 changed files with 2390 additions and 0 deletions

8
bastardkb/info.json Normal file
View file

@ -0,0 +1,8 @@
{
"manufacturer": "Bastard Keyboards",
"maintainer": "Quentin Lebastard",
"url": "https://bastardkb.com",
"usb": {
"vid": "0xA8F8"
}
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
* Copyright 2021 Stefan Kerkmann (@KarlK90)
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Publicw 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/>.
*/
#pragma once
/* Handedness. */
#define SPLIT_HAND_PIN A3 // High -> left, Low -> right.
/* RGB settings. */
#define WS2812_PWM_DRIVER PWMD2
#define WS2812_PWM_CHANNEL 2
#define WS2812_PWM_PAL_MODE 1
#define WS2812_EXTERNAL_PULLUP
#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM1
#define WS2812_PWM_DMA_CHANNEL 3
#define WS2812_PWM_TARGET_PERIOD 800000
/* Serial configuration for split keyboard. */
#define SERIAL_USART_TX_PIN A9
/* CRC. */
#define CRC8_USE_TABLE
#define CRC8_OPTIMIZE_SPEED
/* SPI config for EEPROM. */
#define SPI_DRIVER SPID1
#define SPI_SCK_PIN A5
#define SPI_SCK_PAL_MODE 5
#define SPI_MOSI_PIN A7
#define SPI_MOSI_PAL_MODE 5
#define SPI_MISO_PIN A6
#define SPI_MISO_PAL_MODE 5
/* EEPROM config. */
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4

View file

@ -0,0 +1,27 @@
/**
* Copyright 2020 Nick Brassel (tzarc)
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#include_next <halconf.h>

View file

@ -0,0 +1,37 @@
{
"keyboard_name": "TBK Mini Blackpill",
"usb": {
"device_version": "1.0.0",
"shared_endpoint": {
"keyboard": true
}
},
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"rgb_matrix": true
},
"eeprom": {
"driver": "spi"
},
"split": {
"enabled": true
},
"rgb_matrix": {
"driver": "ws2812"
},
"ws2812": {
"pin": "A1",
"driver": "pwm"
},
"build": {
"debounce_type": "asym_eager_defer_pk"
},
"matrix_pins": {
"cols": ["B0", "B1", "B10", "B3", "B4", "B5"],
"rows": ["A2", "B8", "A8", "B9"]
},
"diode_direction": "ROW2COL",
"development_board": "blackpill_f411"
}

View file

@ -0,0 +1,37 @@
/*
* Copyright 2020 Nick Brassel (tzarc)
* Copyright 2021 Stefan Kerkmann (@KarlK90)
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
#include_next <mcuconf.h>
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
#undef STM32_PWM_USE_TIM2
#define STM32_PWM_USE_TIM2 TRUE
#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 TRUE
#undef STM32_GPT_USE_TIM3
#define STM32_GPT_USE_TIM3 TRUE
#undef STM32_ST_USE_TIMER
#define STM32_ST_USE_TIMER 5

View file

@ -0,0 +1,5 @@
AUDIO_SUPPORTED = no # Audio is not supported
MOUSE_SHARED_EP = no # Unify multiple HID interfaces into a single Endpoint
SERIAL_DRIVER = usart

View file

@ -0,0 +1,78 @@
{
"url": "https://www.bastardkb.com/tbk-mini",
"usb": {
"pid": "0x1828"
},
"rgb_matrix": {
"max_brightness": 50,
"sleep": true,
"split_count": [21, 21]
},
"rgblight": {
"led_count": 42,
"split_count": [21, 21]
},
"split": {
"transport": {
"sync": {
"matrix_state": true
}
}
},
"community_layouts": ["split_3x6_3"],
"layouts": {
"LAYOUT_split_3x6_3": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [0, 5], "x": 5, "y": 0},
{"matrix": [4, 5], "x": 11, "y": 0},
{"matrix": [4, 4], "x": 12, "y": 0},
{"matrix": [4, 3], "x": 13, "y": 0},
{"matrix": [4, 2], "x": 14, "y": 0},
{"matrix": [4, 1], "x": 15, "y": 0},
{"matrix": [4, 0], "x": 16, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [1, 4], "x": 4, "y": 1},
{"matrix": [1, 5], "x": 5, "y": 1},
{"matrix": [5, 5], "x": 11, "y": 1},
{"matrix": [5, 4], "x": 12, "y": 1},
{"matrix": [5, 3], "x": 13, "y": 1},
{"matrix": [5, 2], "x": 14, "y": 1},
{"matrix": [5, 1], "x": 15, "y": 1},
{"matrix": [5, 0], "x": 16, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [2, 4], "x": 4, "y": 2},
{"matrix": [2, 5], "x": 5, "y": 2},
{"matrix": [6, 5], "x": 11, "y": 2},
{"matrix": [6, 4], "x": 12, "y": 2},
{"matrix": [6, 3], "x": 13, "y": 2},
{"matrix": [6, 2], "x": 14, "y": 2},
{"matrix": [6, 1], "x": 15, "y": 2},
{"matrix": [6, 0], "x": 16, "y": 2},
{"matrix": [3, 3], "x": 5, "y": 3},
{"matrix": [3, 4], "x": 6, "y": 3},
{"matrix": [3, 1], "x": 7, "y": 3},
{"matrix": [7, 1], "x": 9, "y": 3},
{"matrix": [7, 4], "x": 10, "y": 3},
{"matrix": [7, 3], "x": 11, "y": 3}
]
}
}
}

View file

@ -0,0 +1,69 @@
/*
* Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
QK_BOOT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, KC_SPC, MO(1), MO(2), KC_ENT, KC_RALT
//`--------------------------' `--------------------------'
),
[1] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, KC_SPC, _______, MO(3), KC_ENT, KC_RALT
//`--------------------------' `--------------------------'
),
[2] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, KC_SPC, MO(3), _______, KC_ENT, KC_RALT
//`--------------------------' `--------------------------'
),
[3] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, KC_SPC, _______, _______, KC_ENT, KC_RALT
//`--------------------------' `--------------------------'
)};

View file

@ -0,0 +1,98 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
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/>.
*/
#pragma once
#define VIAL_KEYBOARD_UID {0xAB, 0xB3, 0x53, 0xD6, 0x2C, 0xC7, 0xDF, 0xDF}
/* Select hand configuration */
#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS
//#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 300
#define LANG_CHANGE_DEFAULT LANG_CHANGE_CAPS
// #define LANG_CHANGE_DEFAULT LANG_CHANGE_ALT_SHIFT
// #define LANG_CHANGE_DEFAULT LANG_CHANGE_CTRL_SHIFT
// #define LANG_CHANGE_DEFAULT LANG_CHANGE_WIN_SPACE
// #define RGB_MATRIX_ENABLE
// #define RGBLIGHT_LAYERS
#define DYNAMIC_KEYMAP_LAYER_COUNT 16
#define RGB_MATRIX_DRIVER ws2812
// #define ENABLE_RGB_MATRIX_SOLID_COLOR
#define SPLIT_LAYER_STATE_ENABLE
// Holding mouse movement keys moves the cursor at constant speeds
#define MK_3_SPEED
// The chosen speed is only active while you hold the respective key. When the key is raised, mouse keys returns to the unmodified speed.
// Momentary: KC_ACL0 < KC_ACL1 < unmodified < KC_ACL2
// #define MK_MOMENTARY_ACCEL
// Cursor offset per movement (unmodified). Default: 16
// #define MK_C_OFFSET_UNMOD 16
// Time between cursor movements (unmodified). Default: 16
// #define MK_C_INTERVAL_UNMOD 16
// Cursor offset per movement (KC_ACL0). Default: 1
// #define MK_C_OFFSET_0 1
// Time between cursor movements (KC_ACL0). Default: 32
// #define MK_C_INTERVAL_0 32
// Cursor offset per movement (KC_ACL1). Default: 4
// #define MK_C_OFFSET_1 4
// Time between cursor movements (KC_ACL1). Default: 16
// #define MK_C_INTERVAL_1 16
// Cursor offset per movement (KC_ACL2). Default: 32
// #define MK_C_OFFSET_2 32
// Time between cursor movements (KC_ACL2). Default: 16
// #define MK_C_INTERVAL_2 16
// Scroll steps per scroll action (unmodified). Default: 1
// #define MK_W_OFFSET_UNMOD 1
// Time between scroll steps (unmodified). Default: 40
// #define MK_W_INTERVAL_UNMOD 40
// Scroll steps per scroll action (KC_ACL0). Default: 1
// #define MK_W_OFFSET_0 1
// Time between scroll steps (KC_ACL0). Default: 360
// #define MK_W_INTERVAL_0 360
// Scroll steps per scroll action (KC_ACL1). Default: 1
// #define MK_W_OFFSET_1 1
// Time between scroll steps (KC_ACL1). Default: 120
// #define MK_W_INTERVAL_1 120
// Scroll steps per scroll action (KC_ACL2). Default: 1
// #define MK_W_OFFSET_2 1
// Time between scroll steps (KC_ACL2). Default: 20
// #define MK_W_INTERVAL_2 20

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View file

@ -0,0 +1,282 @@
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>
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
#include "rgb_matrix.h"
#define CUSTOM_SAFE_RANGE SAFE_RANGE
#include "lang_shift/include.h"
#define L_ENG 0
#define L_GAME 1
#define L_RU 2
#define L_MEDIA 3
#define L_NAV 4
#define L_MOUSE 5
#define L_SYM 6
#define L_NUM 7
#define L_FUN 8
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[L_ENG] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
KC_ESC, G(KC_ESC), XXXXXXX, KC_X, KC_Q, DF(L_GAME), KC_J, KC_D, KC_L, KC_K, KC_C, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
KC_F, LWIN_T(KC_S),ALT_T(KC_E),CTL_T(KC_O),SFT_T(KC_A), XXXXXXX, KC_G, SFT_T(KC_T),CTL_T(KC_N),ALT_T(KC_V),LWIN_T(KC_H), XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_W, KC_U, KC_Y, KC_I, XXXXXXX, KC_B, KC_M, KC_R, KC_P, KC_Z, LA_CHNG,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
LT(L_MEDIA, KC_ENT), LT(L_MOUSE, KC_SPC), MO(L_NAV), MO(L_SYM), LT(L_FUN, KC_BSPC), MO(L_NUM)
//`+--------------------+--------------------+--------------------||--------------------+--------------------+--------------------+'
),
[L_RU] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
KC_ESC, KC_O, KC_QUOT, KC_Z, KC_S, KC_RBRC, KC_Q, KC_L, KC_K, KC_R, KC_W, KC_SCLN,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
KC_A, LWIN_T(KC_C),ALT_T(KC_T),CTL_T(KC_J),SFT_T(KC_F), KC_M, KC_U, SFT_T(KC_N),CTL_T(KC_Y),ALT_T(KC_D),LWIN_T(KC_LBRC), KC_X,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
LA_CHNG, KC_I, KC_DOT, KC_E, KC_B, KC_GRV, KC_COMM, KC_V, KC_H, KC_G, KC_P, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
LT(L_MEDIA, KC_ENT), LT(L_MOUSE, KC_SPC), MO(L_NAV), MO(L_SYM), LT(L_FUN, KC_BSPC), MO(L_NUM)
//`+--------------------+--------------------+--------------------||--------------------+--------------------+--------------------+'
),
[L_MEDIA] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
QK_BOOT, KC_RWIN, KC_RALT, KC_RCTL, KC_RSFT, XXXXXXX, NK_ON, KC_VOLD, KC_VOLU, LA_SYNC, RGB_TOG, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_LWIN, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, NK_TOGG, KC_MPLY, KC_MPRV, KC_MNXT, KC_MUTE, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_RWIN, KC_RALT, KC_RCTL, KC_RSFT, XXXXXXX, NK_OFF, LA_CAPS, LA_ALSH, LA_CTSH, LA_WISP, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_NAV] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
XXXXXXX, XXXXXXX, C(KC_Z), C(KC_C), C(KC_V), XXXXXXX, C(KC_Y), C(KC_V), C(KC_C), C(KC_X), C(KC_Z), C(KC_S),
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
C(KC_F), KC_LWIN, KC_LALT, KC_LCTL, KC_LSFT, S(KC_CAPS), XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TAB,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, XXXXXXX, C(KC_Y), C(KC_A), C(KC_X), XXXXXXX, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_DEL,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_MOUSE] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
XXXXXXX, KC_BTN5, KC_BTN1, KC_BTN3, KC_BTN2, XXXXXXX, C(KC_Y), C(KC_V), C(KC_C), C(KC_X), C(KC_Z), C(KC_S),
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_LWIN, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TAB,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_BTN4, KC_ACL2, KC_ACL1, KC_ACL0, XXXXXXX, KC_INS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_DEL,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN3, KC_BTN2
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_SYM] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
XXXXXXX, EN_AT, EN_HASH, ONCE_SHIFT, AG_DOT, EN_CIRC, EN_AMPR, AG_ASTR, AG_MINS, AG_EQL, AG_PLUS, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
AG_COMM, AG_EXCL, AG_QUES, COMMA_SPACE, SMART_DOT, AG_PERC, EN_PIPE, AG_LPRN, EN_LBRC, EN_LCBR, EN_LT, EN_GRV,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
CW_TOGG, EN_SLSH, RU_NUME, AG_DQUO, EN_QUOT, EN_DLR, AG_BSLS, AG_RPRN, EN_RBRC, EN_RCBR, EN_GT, EN_TILD,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
AG_UNDS, AG_COLN, AG_SCLN, XXXXXXX, XXXXXXX, XXXXXXX
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_NUM] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
XXXXXXX, XXXXXXX, AG_1, AG_2, AG_3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, AG_0, AG_4, AG_5, AG_6, XXXXXXX, XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LWIN, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_PSCR, AG_7, AG_8, AG_9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
KC_ENT, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_FUN] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
XXXXXXX, KC_F10, KC_F1, KC_F2, KC_F3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_F11, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LWIN, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, KC_F12, KC_F7, KC_F8, KC_F9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
//`+-----------+-----------+-----------||-----------+-----------+-----------+'
),
[L_GAME] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
KC_TAB, KC_T, KC_Q, KC_W, KC_E, KC_R, KC_Y, KC_U, KC_I, KC_O, KC_P, DF(L_ENG),
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
KC_LSFT, KC_G, KC_A, KC_S, KC_D, KC_F, KC_H, KC_J, KC_UP, KC_K, KC_L, KC_GRV,
//|-----------+-----------+-----------+-----------+-----------+-----------| |-----------+-----------+-----------+-----------+-----------+-----------|
KC_LCTL, KC_B, KC_Z, KC_X, KC_C, KC_V, KC_N, KC_LEFT, KC_DOWN, KC_RGHT, KC_M, KC_SLSH,
//|-----------+-----------+-----------+-----------+-----------+-----------+-----------||-----------+-----------+-----------+-----------+-----------+-----------+-----------|
KC_LALT, KC_SPC, LT(L_NUM, KC_ESC), KC_H, KC_SPC, LT(L_FUN, KC_ENT)
//`+--------------------+--------------------+--------------------||--------------------+--------------------+--------------------+'
)
};
bool shift_on_next_key = false;
// Обработка нажатий?
bool process_record_user(uint16_t keycode, keyrecord_t *record) { // В конце должно быть true, чтоб символ напечатался.
// lang_shift
if (!lang_shift_process_record(keycode, record))
return false;
// Одиночный шифт от GPT4. Потому что одиночный шифт lang_shift не нравится. Но этот шифт не умеет работать с кастом кейкодами lang_shift
if (keycode == ONCE_SHIFT && record->event.pressed) {
shift_on_next_key = true;
return false;
}
if (shift_on_next_key && record->event.pressed) {
register_code(KC_LSFT);
register_code(keycode);
unregister_code(keycode);
unregister_code(KC_LSFT);
shift_on_next_key = false;
return false;
}
// Умная точка
if (keycode == SMART_DOT && record->event.pressed) {
lang_shift_tap_key(AG_DOT);
register_code(KC_SPC);
unregister_code(KC_SPC);
shift_on_next_key = true;
return false;
}
// Запятая + пробел
if (keycode == COMMA_SPACE && record->event.pressed) {
lang_shift_tap_key(AG_COMM);
register_code(KC_SPC);
unregister_code(KC_SPC);
return false;
}
return true; // Если условия выше не сработали, то отправить символ как есть
};
void user_timer(void) {
lang_shift_user_timer();
};
// Lighting Layers
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
for (uint8_t i = led_min; i < led_max; i++) {
switch(get_highest_layer(layer_state|default_layer_state)) {
case L_ENG:
rgb_matrix_set_color(i, RGB_PINK);
break;
case L_RU:
rgb_matrix_set_color(i, RGB_PURPLE);
break;
case L_MEDIA:
rgb_matrix_set_color(i, RGB_MAGENTA);
break;
case L_NAV:
rgb_matrix_set_color(i, RGB_CYAN);
break;
case L_MOUSE:
rgb_matrix_set_color(i, RGB_YELLOW);
break;
case L_SYM:
rgb_matrix_set_color(i, RGB_GREEN);
break;
case L_NUM:
rgb_matrix_set_color(i, RGB_BLUE);
break;
case L_FUN:
rgb_matrix_set_color(i, RGB_RED);
break;
case L_GAME:
rgb_matrix_set_color(i, RGB_ORANGE);
break;
default: // for any other layers, or the default layer
rgb_matrix_set_color(i, RGB_WHITE);
break;
}
}
return false;
}
void matrix_scan_user(void) {
user_timer();
// // Проверяем, активен ли слой
// if (!layer_state_cmp(layer_state, L_MEDIA) &&
// !layer_state_cmp(layer_state, L_NAV) &&
// !layer_state_cmp(layer_state, L_MOUSE) &&
// !layer_state_cmp(layer_state, L_SYM) &&
// !layer_state_cmp(layer_state, L_NUM) &&
// !layer_state_cmp(layer_state, L_FUN) &&
// !layer_state_cmp(layer_state, L_RU)) {
// // Если ни один из этих слоев не активен, обновляем подсветку на основе текущего базового слоя
// default_layer_state_set_user(default_layer_state);
// }
}
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:
case KC_QUOT:
case KC_RBRC:
case KC_SCLN:
case KC_COMM:
case KC_GRV:
case KC_LBRC:
case KC_DOT:
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:
return true;
default:
return false; // Deactivate Caps Word.
}
}

View file

@ -0,0 +1,341 @@
#pragma once
#ifndef CUSTOM_SAFE_RANGE
#error "You must specify variable CUSTOM_SAFE_RANGE for lang_shift extension."
#endif
enum lang_shift_keycodes {
LANG_SHIFT_START = CUSTOM_SAFE_RANGE,
// Кейкоды, на основе которых реализуются кейкоды ниже, пользователю их лучше не использовать.
#include "private_keycodes.h"
/* -------------------------------------------------------------------- */
/* Английские символы */
EN_GRV, /* ` */
EN_TILD, /* ~ */
EN_1, /* 1 */
EN_EXCL, /* ! */
EN_2, /* 2 */
EN_AT, /* @ */
EN_3, /* 3 */
EN_HASH, /* # */
EN_4, /* 4 */
EN_DLR, /* $ */
EN_5, /* 5 */
EN_PERC, /* % */
EN_6, /* 6 */
EN_CIRC, /* ^ */
EN_7, /* 7 */
EN_AMPR, /* & */
EN_8, /* 8 */
EN_ASTR, /* * */
EN_9, /* 9 */
EN_LPRN, /* ( */
EN_0, /* 0 */
EN_RPRN, /* ) */
EN_MINS, /* - */
EN_UNDS, /* _ */
EN_EQL, /* = */
EN_PLUS, /* + */
EN_Q, /* q */
EN_S_Q, /* Q */
EN_W, /* w */
EN_S_W, /* W */
EN_E, /* e */
EN_S_E, /* E */
EN_R, /* r */
EN_S_R, /* R */
EN_T, /* t */
EN_S_T, /* T */
EN_Y, /* y */
EN_S_Y, /* Y */
EN_U, /* u */
EN_S_U, /* U */
EN_I, /* i */
EN_S_I, /* I */
EN_O, /* o */
EN_S_O, /* O */
EN_P, /* p */
EN_S_P, /* P */
EN_LBRC, /* [ */
EN_LCBR, /* { */
EN_RBRC, /* ] */
EN_RCBR, /* } */
EN_A, /* a */
EN_S_A, /* A */
EN_S, /* s */
EN_S_S, /* S */
EN_D, /* d */
EN_S_D, /* D */
EN_F, /* f */
EN_S_F, /* F */
EN_G, /* g */
EN_S_G, /* G */
EN_H, /* h */
EN_S_H, /* H */
EN_J, /* j */
EN_S_J, /* J */
EN_K, /* k */
EN_S_K, /* K */
EN_L, /* l */
EN_S_L, /* L */
EN_SCLN, /* ; */
EN_COLN, /* : */
EN_QUOT, /* ' */
EN_DQUO, /* " */
EN_BSLS, /* \ */
EN_PIPE, /* | */
EN_Z, /* z */
EN_S_Z, /* Z */
EN_X, /* x */
EN_S_X, /* X */
EN_C, /* c */
EN_S_C, /* C */
EN_V, /* v */
EN_S_V, /* V */
EN_B, /* b */
EN_S_B, /* B */
EN_N, /* n */
EN_S_N, /* N */
EN_M, /* m */
EN_S_M, /* M */
EN_COMM, /* , */
EN_LT, /* < */
EN_DOT, /* . */
EN_GT, /* > */
EN_SLSH, /* / */
EN_QUES, /* ? */
/* -------------------------------------------------------------------- */
/* Русские символы */
RU_JO, /* ё */
RU_S_JO, /* Ё */
RU_1, /* 1 */
RU_EXCL, /* ! */
RU_2, /* 2 */
RU_DQUO, /* " */
RU_3, /* 3 */
RU_NUME, /* № */
RU_4, /* 4 */
RU_SCLN, /* ; */
RU_5, /* 5 */
RU_PERC, /* % */
RU_6, /* 6 */
RU_COLN, /* : */
RU_7, /* 7 */
RU_QUES, /* ? */
RU_8, /* 8 */
RU_ASTR, /* * */
RU_9, /* 9 */
RU_LPRN, /* ( */
RU_0, /* 0 */
RU_RPRN, /* ) */
RU_MINS, /* - */
RU_UNDS, /* _ */
RU_EQL, /* = */
RU_PLUS, /* + */
RU_J, /* й */
RU_S_J, /* Й */
RU_TS, /* ц */
RU_S_TS, /* Ц */
RU_U, /* у */
RU_S_U, /* У */
RU_K, /* к */
RU_S_K, /* К */
RU_JE, /* е */
RU_S_JE, /* Е */
RU_N, /* н */
RU_S_N, /* Н */
RU_G, /* г */
RU_S_G, /* Г */
RU_SH, /* ш */
RU_S_SH, /* Ш */
RU_SC, /* щ */
RU_S_SC, /* Щ */
RU_Z, /* з */
RU_S_Z, /* З */
RU_H, /* х */
RU_S_H, /* Х */
RU_HD, /* ъ */
RU_S_HD, /* Ъ */
RU_F, /* ф */
RU_S_F, /* Ф */
RU_Y, /* ы */
RU_S_Y, /* Ы */
RU_V, /* в */
RU_S_V, /* В */
RU_A, /* а */
RU_S_A, /* А */
RU_P, /* п */
RU_S_P, /* п */
RU_R, /* р */
RU_S_R, /* Р */
RU_O, /* о */
RU_S_O, /* О */
RU_L, /* л */
RU_S_L, /* Л */
RU_D, /* д */
RU_S_D, /* Д */
RU_ZH, /* ж */
RU_S_ZH, /* Ж */
RU_E, /* э */
RU_S_E, /* Э */
RU_BSLS, /* \ */
RU_SLSH, /* / */
RU_JA, /* я */
RU_S_JA, /* Я */
RU_CH, /* ч */
RU_S_CH, /* Ч */
RU_S, /* с */
RU_S_S, /* С */
RU_M, /* м */
RU_S_M, /* М */
RU_I, /* и */
RU_S_I, /* И */
RU_T, /* т */
RU_S_T, /* Т */
RU_SF, /* ь */
RU_S_SF, /* Ь */
RU_B, /* б */
RU_S_B, /* Б */
RU_JU, /* ю */
RU_S_JU, /* Ю */
RU_DOT, /* . */
RU_COMM, /* , */
/* -------------------------------------------------------------------- */
/* Символы, нажимаемые независимо от текущего языка. Language-agnostic-keycodes. */
AG_1, /* 1 */
AG_2, /* 2 */
AG_3, /* 3 */
AG_4, /* 4 */
AG_5, /* 5 */
AG_6, /* 6 */
AG_7, /* 7 */
AG_8, /* 8 */
AG_9, /* 9 */
AG_0, /* 0 */
AG_EXCL, /* ! */
AG_PERC, /* % */
AG_ASTR, /* * */
AG_LPRN, /* ( */
AG_RPRN, /* ) */
AG_MINS, /* - */
AG_UNDS, /* _ */
AG_EQL, /* = */
AG_PLUS, /* + */
AG_SCLN, /* ; */
AG_COLN, /* : */
AG_DQUO, /* " */
AG_BSLS, /* \ */
AG_COMM, /* , */
AG_DOT, /* . */
AG_SLSH, /* / */
AG_QUES, /* ? */
/* -------------------------------------------------------------------- */
/* Кастомные language-agnostic-кейкоды */
AG_3DOT, /* ... */
AG_SDOT, /* Space + Dot + Shift to next key */
AG_CMSP, /* Comma + Space */
/* -------------------------------------------------------------------- */
/* Шифты для набора текста. */
SFT_N, /* Работает как обычный шифт, при её зажатии, шифт зажат. Параллельно переключает на (шифтовый) следующий слой относительно текущего языка (если язык 0, то включает слой 1, если язык 1, то включает слой 3). */
SFT_N_O, /* Данная клавиша применит шифт и переключение на шифтовый слой только к следующему символу. Неважно, была ли она нажата одновременно со следующей клавишей, или до неё, или вместе с двумя клавишами. Применится только к одной клавише. То есть это как залипающий шифт, если нажимать отдельно от всех клавиш, и как одиночный шифт, если эту клавишу зажимать. Такая клавиша может пригодиться если вы печатаете с большой скоростью и вам сложно выдерживать время удержания шифта, и у вас получается что-то вроде "ПРивет". */
/* -------------------------------------------------------------------- */
/* Модификаторы, переключащие текущий слой на 0. Такое нужно чтобы при включённом русском языке были такие же хоткеи с модификаторами, как и на английском языке. */
CTRL_0, /* Ctrl on 0 layer */
ALT_0, /* Alt on 0 layer */
WIN_0, /* Win on 0 layer */
SHAL_0, /* Shift+Alt on 0 layer */
CTAL_0, /* Ctrl+Alt on 0 layer */
CTSH_0, /* Ctrl+Shift on 0 layer */
MCAS_0, /* Ctrl+Alt+Shift on 0 layer */
/* А данные модификаторы помимо включения 0 слоя ещё и переключают язык на английский. Такое разделение нужно, потому что у некоторых смена языка идёт на комбинации с Ctrl, или Shift, и у них может сниматься выделение текста, например. */
CTRL_EN, /* Ctrl on 0 layer */
ALT_EN, /* Alt on 0 layer */
WIN_EN, /* Win on 0 layer */
SHAL_EN, /* Shift+Alt on 0 layer */
CTAL_EN, /* Ctrl+Alt on 0 layer */
CTSH_EN, /* Ctrl+Shift on 0 layer */
MCAS_EN, /* Ctrl+Alt+Shift on 0 layer */
/* -------------------------------------------------------------------- */
/* Кнопки, отвечающие за переключение языка. */
LA_CHNG, /* Переключает язык и переключает на 2 или 0 слой в зависимости от текущего языка. */
LA_SYNC, /* Кнопка для синхронизации языков. Её нужно нажимать в случае если язык в системе и язык в клавиатуре различаются. Данная клавиша изменит язык в системе. */
LA_CAPS, /* Задаёт переключение языка на Caps. */
LA_ALSH, /* Задаёт переключение языка на Alt + Shift. */
LA_SHAL, /* Задаёт переключение языка на Shift + Alt. На Win10 это позволяет избежать появления окна переключения языков. */
LA_CTSH, /* Задаёт переключение языка на Ctrl + Shift. */
LA_SHCT, /* Задаёт переключение языка на Shift + Ctrl. На Win10 это позволяет избежать появления окна переключения языков. */
LA_WISP, /* Задаёт переключение языка на Win + Shift. */
/* -------------------------------------------------------------------- */
/* Кейкоды от Buliway. */
ONCE_SHIFT, /* Зажимает шифт до тех пор, пока не будет нажата любая другая клавиша. Не работает с кастом кейкодами, только стандартные */
SMART_DOT, /* Отправить агностик точку из lang_shift, нажать пробел, активировать одиночный шифт ONCE_SHIFT */
COMMA_SPACE, /* Отправить агностик запятую из lang_shift, нажать пробел */
/* -------------------------------------------------------------------- */
/* SAFE_RANGE данной библиотеки. */
LANG_SHIFT_NEW_SAFE_RANGE,
#undef CUSTOM_SAFE_RANGE
#define CUSTOM_SAFE_RANGE LANG_SHIFT_NEW_SAFE_RANGE
};
typedef uint16_t Key;
#define NONE_KEY (uint16_t)(65535)
typedef uint8_t Lang;
#define NONE_LANG (uint8_t)(255)
typedef uint8_t Shift;
#define NONE_SHIFT (uint8_t)(255)
// Способ смены языка
enum LangChange {
LANG_CHANGE_CAPS,
LANG_CHANGE_ALT_SHIFT,
LANG_CHANGE_SHIFT_ALT,
LANG_CHANGE_CTRL_SHIFT,
LANG_CHANGE_SHIFT_CTRL,
LANG_CHANGE_WIN_SPACE
};
// Переменная, в которой можно менять текущий способ смены языка
enum LangChange lang_current_change =
#ifdef LANG_CHANGE_DEFAULT
LANG_CHANGE_DEFAULT;
#else
#error "You must specify default language change method by defining variable LANG_CHANGE_DEFAULT."
#endif
void shift_activate(Shift shift);
void shift_activate_from_user(Shift shift);
void shift_once_use_to_next_key(uint8_t layer);
uint8_t lang_get_shift_layer_number(void);
void lang_synchronize(void);
void lang_activate(Lang lang);
void lang_activate_from_user(Lang lang);
void lang_shift_press_key(Key key, bool down);
void lang_shift_tap_key(Key key);
bool lang_shift_process_record(Key key, keyrecord_t* record);
void lang_shift_user_timer(void);
// Инклюжу код напрямую, потому что нельзя сделать линковку, ведь код внутри использует кейкоды отсюда, и обязательно нужно это делать через safe_range
#include "src.c"

View file

@ -0,0 +1,97 @@
KS_GRV, /* ` */
KS_TILD, /* ~ */
KS_1, /* 1 */
KS_EXCL, /* ! */
KS_2, /* 2 */
KS_AT, /* @ */
KS_3, /* 3 */
KS_HASH, /* # */
KS_4, /* 4 */
KS_DLR, /* $ */
KS_5, /* 5 */
KS_PERC, /* % */
KS_6, /* 6 */
KS_CIRC, /* ^ */
KS_7, /* 7 */
KS_AMPR, /* & */
KS_8, /* 8 */
KS_ASTR, /* * */
KS_9, /* 9 */
KS_LPRN, /* ( */
KS_0, /* 0 */
KS_RPRN, /* ) */
KS_MINS, /* - */
KS_UNDS, /* _ */
KS_EQL, /* = */
KS_PLUS, /* + */
KS_Q, /* q */
KS_S_Q, /* Q */
KS_W, /* w */
KS_S_W, /* W */
KS_E, /* e */
KS_S_E, /* E */
KS_R, /* r */
KS_S_R, /* R */
KS_T, /* t */
KS_S_T, /* T */
KS_Y, /* y */
KS_S_Y, /* Y */
KS_U, /* u */
KS_S_U, /* U */
KS_I, /* i */
KS_S_I, /* I */
KS_O, /* o */
KS_S_O, /* O */
KS_P, /* p */
KS_S_P, /* P */
KS_LBRC, /* [ */
KS_LCBR, /* { */
KS_RBRC, /* ] */
KS_RCBR, /* } */
KS_A, /* a */
KS_S_A, /* A */
KS_S, /* s */
KS_S_S, /* S */
KS_D, /* d */
KS_S_D, /* D */
KS_F, /* f */
KS_S_F, /* F */
KS_G, /* g */
KS_S_G, /* G */
KS_H, /* h */
KS_S_H, /* H */
KS_J, /* j */
KS_S_J, /* J */
KS_K, /* k */
KS_S_K, /* K */
KS_L, /* l */
KS_S_L, /* L */
KS_SCLN, /* ; */
KS_COLN, /* : */
KS_QUOT, /* ' */
KS_DQUO, /* " */
KS_BSLS, /* \ */
KS_PIPE, /* | */
KS_Z, /* z */
KS_S_Z, /* Z */
KS_X, /* x */
KS_S_X, /* X */
KS_C, /* c */
KS_S_C, /* C */
KS_V, /* v */
KS_S_V, /* V */
KS_B, /* b */
KS_S_B, /* B */
KS_N, /* n */
KS_S_N, /* N */
KS_M, /* m */
KS_S_M, /* M */
KS_COMM, /* , */
KS_LT, /* < */
KS_DOT, /* . */
KS_GT, /* > */
KS_SLSH, /* / */
KS_QUES, /* ? */

View file

@ -0,0 +1,665 @@
// ---------------------------------------------------------------------------
// Работа с шифтом
// ---------------------------------------------------------------------------
Shift shift_should_be = 0;
Shift shift_current = 0;
uint32_t shift_timer = 0;
uint8_t shift_pressed_count = 0;
Key shift_get_key(Key key) {
switch (key) {
case KS_GRV: return KC_GRV;
case KS_TILD: return KC_GRV;
case KS_1: return KC_1;
case KS_EXCL: return KC_1;
case KS_2: return KC_2;
case KS_AT: return KC_2;
case KS_3: return KC_3;
case KS_HASH: return KC_3;
case KS_4: return KC_4;
case KS_DLR: return KC_4;
case KS_5: return KC_5;
case KS_PERC: return KC_5;
case KS_6: return KC_6;
case KS_CIRC: return KC_6;
case KS_7: return KC_7;
case KS_AMPR: return KC_7;
case KS_8: return KC_8;
case KS_ASTR: return KC_8;
case KS_9: return KC_9;
case KS_LPRN: return KC_9;
case KS_0: return KC_0;
case KS_RPRN: return KC_0;
case KS_MINS: return KC_MINS;
case KS_UNDS: return KC_MINS;
case KS_EQL: return KC_EQL;
case KS_PLUS: return KC_EQL;
case KS_Q: return KC_Q;
case KS_S_Q: return KC_Q;
case KS_W: return KC_W;
case KS_S_W: return KC_W;
case KS_E: return KC_E;
case KS_S_E: return KC_E;
case KS_R: return KC_R;
case KS_S_R: return KC_R;
case KS_T: return KC_T;
case KS_S_T: return KC_T;
case KS_Y: return KC_Y;
case KS_S_Y: return KC_Y;
case KS_U: return KC_U;
case KS_S_U: return KC_U;
case KS_I: return KC_I;
case KS_S_I: return KC_I;
case KS_O: return KC_O;
case KS_S_O: return KC_O;
case KS_P: return KC_P;
case KS_S_P: return KC_P;
case KS_LBRC: return KC_LBRC;
case KS_LCBR: return KC_LBRC;
case KS_RBRC: return KC_RBRC;
case KS_RCBR: return KC_RBRC;
case KS_A: return KC_A;
case KS_S_A: return KC_A;
case KS_S: return KC_S;
case KS_S_S: return KC_S;
case KS_D: return KC_D;
case KS_S_D: return KC_D;
case KS_F: return KC_F;
case KS_S_F: return KC_F;
case KS_G: return KC_G;
case KS_S_G: return KC_G;
case KS_H: return KC_H;
case KS_S_H: return KC_H;
case KS_J: return KC_J;
case KS_S_J: return KC_J;
case KS_K: return KC_K;
case KS_S_K: return KC_K;
case KS_L: return KC_L;
case KS_S_L: return KC_L;
case KS_SCLN: return KC_SCLN;
case KS_COLN: return KC_SCLN;
case KS_QUOT: return KC_QUOT;
case KS_DQUO: return KC_QUOT;
case KS_BSLS: return KC_BSLS;
case KS_PIPE: return KC_BSLS;
case KS_Z: return KC_Z;
case KS_S_Z: return KC_Z;
case KS_X: return KC_X;
case KS_S_X: return KC_X;
case KS_C: return KC_C;
case KS_S_C: return KC_C;
case KS_V: return KC_V;
case KS_S_V: return KC_V;
case KS_B: return KC_B;
case KS_S_B: return KC_B;
case KS_N: return KC_N;
case KS_S_N: return KC_N;
case KS_M: return KC_M;
case KS_S_M: return KC_M;
case KS_COMM: return KC_COMM;
case KS_LT: return KC_COMM;
case KS_DOT: return KC_DOT;
case KS_GT: return KC_DOT;
case KS_SLSH: return KC_SLSH;
case KS_QUES: return KC_SLSH;
default: return NONE_KEY;
}
}
Shift shift_get_shift(Key key) {
if (KS_GRV <= key && key <= KS_QUES) {
return (key - KS_GRV) % 2;
} else {
return NONE_SHIFT;
}
}
void shift_activate(Shift shift) {
if (shift_current != shift) {
shift_timer = timer_read();
if (shift) {
register_code(KC_LSFT);
} else {
unregister_code(KC_LSFT);
}
}
shift_current = shift;
}
void shift_activate_from_user(Shift shift) {
shift_should_be = shift;
shift_activate(shift);
}
Key shift_process(Key key, bool down) {
Shift new_shift = shift_get_shift(key);
if (down) {
if (new_shift != NONE_SHIFT) {
shift_activate(new_shift);
} else {
shift_activate(shift_should_be);
}
}
if (new_shift != NONE_SHIFT) {
if (down) {
shift_pressed_count++;
} else {
shift_pressed_count--;
}
}
return shift_get_key(key);
}
void shift_user_timer(void) {
// Нужно выключать шифт после прохождения определённого времени, потому что пользователь ожидает как будто шифт на самом деле включён
if (shift_pressed_count == 0 && shift_current != shift_should_be && timer_read() - shift_timer >= 100) {
shift_activate(shift_should_be);
shift_timer = timer_read();
}
}
// ---------------------------------------------------------------------------
// Работа с одиночным шифтом
// ---------------------------------------------------------------------------
uint8_t shift_once_disable_stage = 2;
uint8_t shift_once_layer_off = 0;
uint8_t shift_once_layer_current = 0;
uint32_t shift_once_enabled_time = 0;
bool shift_once_can_disable = true;
bool shift_once_is_enabled(void) {
return shift_once_disable_stage == 2;
}
void shift_once_use_to_next_key(uint8_t layer) {
if (shift_current == 0) {
shift_activate_from_user(true);
layer_on(layer);
shift_once_disable_stage = 2;
shift_once_layer_off = layer;
shift_once_enabled_time = timer_read();
}
}
void shift_once_process_key(uint8_t layer, bool down) {
if (down) {
shift_once_use_to_next_key(layer);
shift_once_can_disable = false;
} else {
shift_once_can_disable = true;
shift_once_enabled_time = timer_read();
}
}
void shift_once_disable(void) {
if (shift_once_disable_stage == 2) {
layer_off(shift_once_layer_off);
shift_activate_from_user(false);
shift_once_disable_stage = 0;
}
}
void shift_once_process(Key key, keyrecord_t* record) {
bool down = record->event.pressed;
if (shift_once_disable_stage == 1) {
shift_once_disable_stage = 0;
shift_activate_from_user(false);
}
if (down && key != SFT_N_O && shift_once_disable_stage == 2) {
shift_once_disable_stage = 1;
layer_off(shift_once_layer_off);
}
}
void shift_once_user_timer(void) {
if (shift_once_can_disable && shift_once_is_enabled() && timer_read() - shift_once_enabled_time >= 1000) {
shift_once_disable();
}
}
// ---------------------------------------------------------------------------
// Работа с языком
// ---------------------------------------------------------------------------
Lang lang_should_be = 0;
Lang lang_current = 0;
uint32_t lang_timer = 0;
uint8_t lang_pressed_count = 0;
Key lang_get_key(Key key) {
if (EN_GRV <= key && key <= EN_QUES) {
return (key - EN_GRV) + KS_GRV;
} else if (RU_JO <= key && key <= RU_COMM) {
return (key - RU_JO) + KS_GRV;
} else {
return NONE_KEY;
}
}
Lang lang_get_lang(Key key) {
if (EN_GRV <= key && key <= EN_QUES) {
return 0;
} else if (RU_JO <= key && key <= RU_COMM) {
return 1;
} else {
return NONE_LANG;
}
}
Key lang_calc_agnostic(Key key) {
if (lang_current == 0) {
switch (key) {
case AG_1: return EN_1;
case AG_2: return EN_2;
case AG_3: return EN_3;
case AG_4: return EN_4;
case AG_5: return EN_5;
case AG_6: return EN_6;
case AG_7: return EN_7;
case AG_8: return EN_8;
case AG_9: return EN_9;
case AG_0: return EN_0;
case AG_EXCL: return EN_EXCL;
case AG_PERC: return EN_PERC;
case AG_ASTR: return EN_ASTR;
case AG_LPRN: return EN_LPRN;
case AG_RPRN: return EN_RPRN;
case AG_MINS: return EN_MINS;
case AG_UNDS: return EN_UNDS;
case AG_EQL: return EN_EQL;
case AG_PLUS: return EN_PLUS;
case AG_SCLN: return EN_SCLN;
case AG_COLN: return EN_COLN;
case AG_DQUO: return EN_DQUO;
case AG_BSLS: return EN_BSLS;
case AG_COMM: return EN_COMM;
case AG_DOT: return EN_DOT;
case AG_SLSH: return EN_SLSH;
case AG_QUES: return EN_QUES;
default: return NONE_KEY;
}
} else {
switch (key) {
case AG_1: return RU_1;
case AG_2: return RU_2;
case AG_3: return RU_3;
case AG_4: return RU_4;
case AG_5: return RU_5;
case AG_6: return RU_6;
case AG_7: return RU_7;
case AG_8: return RU_8;
case AG_9: return RU_9;
case AG_0: return RU_0;
case AG_EXCL: return RU_EXCL;
case AG_PERC: return RU_PERC;
case AG_ASTR: return RU_ASTR;
case AG_LPRN: return RU_LPRN;
case AG_RPRN: return RU_RPRN;
case AG_MINS: return RU_MINS;
case AG_UNDS: return RU_UNDS;
case AG_EQL: return RU_EQL;
case AG_PLUS: return RU_PLUS;
case AG_SCLN: return RU_SCLN;
case AG_COLN: return RU_COLN;
case AG_DQUO: return RU_DQUO;
case AG_BSLS: return RU_BSLS;
case AG_COMM: return RU_COMM;
case AG_DOT: return RU_DOT;
case AG_SLSH: return RU_SLSH;
case AG_QUES: return RU_QUES;
default: return NONE_KEY;
}
}
}
uint8_t lang_get_shift_layer_number(void) {
return lang_should_be * 2 + 1;
}
void lang_synchronize(void) {
lang_timer = timer_read();
switch (lang_current_change) {
case LANG_CHANGE_CAPS: {
// Костыль, потому что при нажатии Shift+Caps включается режим Caps, а не переключение языка :facepalm:
if (shift_current == 1) {
unregister_code(KC_LSFT);
register_code(KC_CAPS);
unregister_code(KC_CAPS);
register_code(KC_LSFT);
} else {
register_code(KC_CAPS);
unregister_code(KC_CAPS);
}
} break;
case LANG_CHANGE_ALT_SHIFT: {
register_code(KC_LALT);
register_code(KC_LSFT);
unregister_code(KC_LSFT);
unregister_code(KC_LALT);
// Костыль, потому что при зажатом шифте если хочется нажать клавишу, которая переключает язык, то шифт слетает...
if (shift_current == 1) {
register_code(KC_LSFT);
}
} break;
case LANG_CHANGE_SHIFT_ALT: {
register_code(KC_LSFT);
register_code(KC_LALT);
unregister_code(KC_LALT);
unregister_code(KC_LSFT);
// Костыль, потому что при зажатом шифте если хочется нажать клавишу, которая переключает язык, то шифт слетает...
if (shift_current == 1) {
register_code(KC_LSFT);
}
} break;
case LANG_CHANGE_CTRL_SHIFT: {
register_code(KC_LCTL);
register_code(KC_LSFT);
unregister_code(KC_LSFT);
unregister_code(KC_LCTL);
// Костыль, потому что при зажатом шифте если хочется нажать клавишу, которая переключает язык, то шифт слетает...
if (shift_current == 1) {
register_code(KC_LSFT);
}
} break;
case LANG_CHANGE_SHIFT_CTRL: {
register_code(KC_LSFT);
register_code(KC_LCTL);
unregister_code(KC_LCTL);
unregister_code(KC_LSFT);
// Костыль, потому что при зажатом шифте если хочется нажать клавишу, которая переключает язык, то шифт слетает...
if (shift_current == 1) {
register_code(KC_LSFT);
}
} break;
case LANG_CHANGE_WIN_SPACE: {
register_code(KC_LGUI);
register_code(KC_SPACE);
unregister_code(KC_SPACE);
unregister_code(KC_LGUI);
} break;
}
}
void lang_activate(Lang lang) {
// Нужно дополнять этот код, если нужно три языка и более
if (lang_current != lang) {
lang_synchronize();
}
lang_current = lang;
}
void lang_activate_from_user(Lang lang) {
lang_should_be = lang;
lang_activate(lang);
}
void lang_activate_from_user_without_sync(Lang lang) {
lang_should_be = lang;
lang_current = lang;
}
Key lang_process(Key key, bool down) {
Key after_agnostic = lang_calc_agnostic(key);
if (after_agnostic != NONE_KEY) {
key = after_agnostic;
}
Lang new_lang = lang_get_lang(key);
if (down) {
if (new_lang != NONE_LANG) {
lang_activate(new_lang);
} else {
lang_activate(lang_should_be);
}
}
if (new_lang != NONE_LANG) {
if (down) {
lang_pressed_count++;
} else {
lang_pressed_count--;
}
}
return lang_get_key(key);
}
void lang_user_timer(void) {
// Нужно выключать язык после прохождения определённого времени, потому что пользователь ожидает как будто шифт на самом деле включён
if (lang_pressed_count == 0 && lang_current != lang_should_be && timer_read() - lang_timer >= 100) {
lang_activate(lang_should_be);
}
}
// ---------------------------------------------------------------------------
// Обработка клавиш
// ---------------------------------------------------------------------------
uint8_t lang_shift_current_shift_layer = 0;
void lang_shift_press_key(Key key, bool down) {
keyrecord_t record = {
.event = {
.key = {
.col = 0,
.row = 0,
},
.pressed = down,
.time = timer_read(),
},
};
lang_shift_process_record(key, &record);
}
void lang_shift_tap_key(Key key) {
lang_shift_press_key(key, true);
lang_shift_press_key(key, false);
shift_activate(shift_should_be);
lang_activate(lang_should_be);
}
bool lang_shift_process_custom_keycodes(Key key, keyrecord_t* record) {
bool down = record->event.pressed;
// Обрабатываем клавиши, связанные с кастомным шифтом и кастомным переключением языка
switch (key) {
case SFT_N_O:
shift_once_process_key(lang_get_shift_layer_number(), down);
return false;
case SFT_N:
if (down) {
shift_activate_from_user(true);
lang_shift_current_shift_layer = lang_get_shift_layer_number();
layer_on(lang_shift_current_shift_layer);
} else {
shift_should_be = false;
if (shift_pressed_count == 0) {
shift_activate_from_user(false);
}
layer_off(lang_shift_current_shift_layer);
}
return false;
case LA_CHNG:
if (down) {
if (lang_should_be == 0) {
lang_activate_from_user(1);
layer_on(2);
} else {
lang_activate_from_user(0);
layer_off(2);
}
}
return false;
case LA_SYNC:
if (down) {
lang_synchronize();
}
return false;
case LA_CAPS:
if (down) {
lang_current_change = LANG_CHANGE_CAPS;
}
return false;
case LA_ALSH:
if (down) {
lang_current_change = LANG_CHANGE_ALT_SHIFT;
}
return false;
case LA_SHAL:
if (down) {
lang_current_change = LANG_CHANGE_SHIFT_ALT;
}
return false;
case LA_CTSH:
if (down) {
lang_current_change = LANG_CHANGE_CTRL_SHIFT;
}
return false;
case LA_SHCT:
if (down) {
lang_current_change = LANG_CHANGE_SHIFT_CTRL;
}
return false;
case LA_WISP:
if (down) {
lang_current_change = LANG_CHANGE_WIN_SPACE;
}
return false;
case AG_3DOT:
if (record->event.pressed) {
lang_shift_tap_key(AG_DOT);
lang_shift_tap_key(AG_DOT);
lang_shift_tap_key(AG_DOT);
}
return false;
break;
case AG_CMSP:
if (record->event.pressed) {
lang_shift_tap_key(AG_COMM);
register_code(KC_SPC);
unregister_code(KC_SPC);
}
return false;
break;
case AG_SDOT:
if (record->event.pressed) {
lang_shift_tap_key(AG_DOT);
register_code(KC_SPC);
unregister_code(KC_SPC);
shift_once_use_to_next_key(lang_get_shift_layer_number());
}
return false;
break;
}
return true;
}
bool lang_shift_process_english_modifiers(Key key, keyrecord_t* record) {
static Lang lang_stack[3] = {};
static uint8_t modifiers_count = 0;
#define PROCESS(NAME, REGISTER, UNREGISTER, ACTIVATE_LANG) \
case NAME: { \
if (record->event.pressed) { \
lang_stack[modifiers_count] = lang_should_be; \
modifiers_count += 1; \
if (lang_should_be == 1) { \
layer_off(2); \
} \
if (ACTIVATE_LANG) { \
lang_activate_from_user(0); \
} else { \
lang_activate_from_user_without_sync(0); \
} \
REGISTER; \
} else { \
UNREGISTER; \
modifiers_count -= 1; \
if (ACTIVATE_LANG) { \
lang_activate_from_user(lang_stack[modifiers_count]); \
} else { \
lang_activate_from_user_without_sync(lang_stack[modifiers_count]); \
} \
if (lang_should_be == 1) { \
layer_on(2); \
} \
} \
return false; \
} break;
#define Rg(x) register_code(KC_L ## x)
#define Un(x) unregister_code(KC_L ## x)
switch (key) {
PROCESS(CTRL_0, Rg(CTL), Un(CTL), false);
PROCESS(ALT_0, Rg(ALT), Un(ALT), false);
PROCESS(WIN_0, Rg(GUI), Un(GUI), false);
PROCESS(CTAL_0, { Rg(CTL); Rg(ALT); }, { Un(ALT); Un(CTL); }, false);
PROCESS(SHAL_0, { Rg(SFT); Rg(ALT); }, { Un(ALT); Un(SFT); }, false);
PROCESS(CTSH_0, { Rg(CTL); Rg(SFT); }, { Un(SFT); Un(CTL); }, false);
PROCESS(MCAS_0, { Rg(CTL); Rg(ALT); Rg(SFT); }, { Un(SFT); Un(ALT); Un(CTL); }, false);
PROCESS(CTRL_EN, Rg(CTL), Un(CTL), true);
PROCESS(ALT_EN, Rg(ALT), Un(ALT), true);
PROCESS(WIN_EN, Rg(GUI), Un(GUI), true);
PROCESS(CTAL_EN, { Rg(CTL); Rg(ALT); }, { Un(ALT); Un(CTL); }, true);
PROCESS(SHAL_EN, { Rg(SFT); Rg(ALT); }, { Un(ALT); Un(SFT); }, true);
PROCESS(CTSH_EN, { Rg(CTL); Rg(SFT); }, { Un(SFT); Un(CTL); }, true);
PROCESS(MCAS_EN, { Rg(CTL); Rg(ALT); Rg(SFT); }, { Un(SFT); Un(ALT); Un(CTL); }, true);
}
return true;
}
bool lang_shift_process_record(Key key, keyrecord_t* record) {
// Обрабатываем Once Shift
shift_once_process(key, record);
bool down = record->event.pressed;
// Разбираемся, имеет ли эта клавиша какой-то язык, заданный в ней
Key key1 = lang_process(key, down);
Key key_to_shift = key;
if (key1 != NONE_KEY) {
key_to_shift = key1;
}
// Разбираемся, имеет ли эта клавиша шифт, засунутый в неё
// Это нужно отдельно от обработки языка, чтобы шифт мог выключаться для обычных клавиш
Key key2 = shift_process(key_to_shift, down);
if (key2 != NONE_KEY) {
if (down) {
register_code(key2);
} else {
unregister_code(key2);
}
return false;
}
if (!lang_shift_process_custom_keycodes(key, record)) {
return false;
}
if (!lang_shift_process_english_modifiers(key, record)) {
return false;
}
return true;
}
void lang_shift_user_timer(void) {
shift_user_timer();
shift_once_user_timer();
lang_user_timer();
}

View file

@ -0,0 +1,21 @@
LTO_ENABLE = yes
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes # Audio control and System control
NKRO_ENABLE = yes
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = ws2812
TAP_DANCE_ENABLE = yes
# VIALRGB_ENABLE = yes
BACKLIGHT_ENABLE = no
MUSIC_ENABLE = no
OLED_ENABLE = no
COMBO_ENABLE = yes
KEY_OVERRIDE_ENABLE = yes
QMK_SETTINGS = yes
CAPS_WORD_ENABLE = yes
VIAL_INSECURE = yes
VIA_ENABLE = yes
VIAL_ENABLE = yes

View file

@ -0,0 +1,82 @@
{
"name": "TBK Mini",
"vendorId": "0xA8F8",
"productId": "0x1828",
"menus": [
"qmk_rgb_matrix"
],
"keycodes": [ "qmk_lighting" ],
"matrix": {
"rows": 8,
"cols": 6
},
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2",
"0,3",
"0,4",
"0,5",
{
"x": 4
},
"4,5",
"4,4",
"4,3",
"4,2",
"4,1",
"4,0"
],
[
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
"1,5",
{
"x": 4
},
"5,5",
"5,4",
"5,3",
"5,2",
"5,1",
"5,0"
],
[
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
"2,5",
{
"x": 4
},
"6,5",
"6,4",
"6,3",
"6,2",
"6,1",
"6,0"
],
[
{
"x": 4
},
"3,3",
"3,4",
"3,1",
{
"x": 2
},
"7,1",
"7,4",
"7,3"
]
]
}
}

View file

@ -0,0 +1,29 @@
# TBK Mini
A split, compact ergonomic keyboard.
* Keyboard Maintainer: [Bastard Keyboards](https://github.com/Bastardkb/)
* Hardware Supported: elite-C V4
* Hardware Availability: [Bastardkb.com](https://bastardkb.com/)
## Building the firmware
**You must specify the shield version when compiling/flashing the firmware.**
The template is:
```shell
qmk compile -kb bastardkb/tbkmini/{VERSION}/elitec -km {KEYMAP}
```
| Shield Version | default | via |
| --------------- | -------------------------------------------------------------- | ---------------------------------------------------------- |
| v1 (Elite-C) | `qmk compile -kb bastardkb/tbkmini/v1/elitec -km default` | `qmk compile -kb bastardkb/tbkmini/v1/elitec -km via` |
| v2 (Elite-C) | `qmk compile -kb bastardkb/tbkmini/v2/elitec -km default` | `qmk compile -kb bastardkb/tbkmini/v2/elitec -km via` |
| v2 (Splinky v2) | `qmk compile -kb bastardkb/tbkmini/v2/splinky/v2 -km default` | `qmk compile -kb bastardkb/tbkmini/v2/splinky/v2 -km via` |
| v2 (Splinky v3) | `qmk compile -kb bastardkb/tbkmini/v2/splinky/v3 -km default` | `qmk compile -kb bastardkb/tbkmini/v2/splinky/v3 -km via` |
| v2 (STeMCell) | `qmk compile -kb bastardkb/tbkmini/v2/stemcell -km default` | `qmk compile -kb bastardkb/tbkmini/v2/stemcell -km via` |
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
See the [keyboard build instructions](http://docs.bastardkb.com/)

View file

@ -0,0 +1,61 @@
/**
* Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
*
* 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 "quantum.h"
// clang-format off
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
// left
{ 0, 5, 6, 11, 12, 15 },
{ 1, 4, 7, 10, 13, 16 },
{ 2, 3, 8, 9, 14, 17 },
{ NO_LED, 18, NO_LED, 19, 20, NO_LED },
// right
{ 21, 26, 27, 32, 33, 36 },
{ 22, 25, 28, 31, 34, 37 },
{ 23, 24, 29, 30, 35, 38 },
{ NO_LED, 39, NO_LED, 40, 41, NO_LED }
}, {
// left
{ 0, 0 }, { 0, 21 }, { 0, 42 }, // col 1
{ 20, 42 }, { 20, 21 }, { 20, 0 }, // col 2
{ 41, 0 }, { 41, 21 }, { 41, 42 },
{ 61, 42 }, { 61, 21 }, { 61, 0 },
{ 81, 0 }, { 81, 21 }, { 81, 42 },
{ 102, 0 }, { 102, 21 }, { 102, 42 },
{ 61, 64 }, { 81, 64 }, { 102, 64 }, // left thumb cluster
// right
{ 224, 0 }, { 224, 21 }, { 224, 42 }, // col 12
{ 204, 42 }, { 204, 21 }, { 204, 0 }, // col 11
{ 183, 0 }, { 183, 21 }, { 183, 42 },
{ 163, 42 }, { 163, 21 }, { 163, 0 },
{ 142, 0 }, { 142, 21 }, { 142, 42 },
{ 122, 0 }, { 122, 21 }, { 122, 42 },
{ 163, 64 }, { 142, 64 }, { 122, 64 } // right thumb cluster
}, {
// left
2, 2, 2, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4,
2, 2, 2,
// right
2, 2, 2, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4,
2, 2, 2
} };
#endif
// clang-format on

View file

@ -0,0 +1,22 @@
/*
* Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
/* Handedness. */
#define MASTER_RIGHT

View file

@ -0,0 +1,29 @@
{
"keyboard_name": "TBK Mini Elite-C",
"usb": {
"device_version": "1.0.0"
},
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"rgb_matrix": true
},
"ws2812": {
"pin": "D2"
},
"rgb_matrix": {
"driver": "ws2812"
},
"matrix_pins": {
"cols": ["B4", "E6", "C6", "B1", "B3", "B2"],
"rows": ["B5", "F7", "F6", "B6"]
},
"diode_direction": "ROW2COL",
"split": {
"enabled": true,
"soft_serial_pin": "D0"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu"
}

View file

@ -0,0 +1 @@
AUDIO_SUPPORTED = no # Audio is not supported

View file

@ -0,0 +1,21 @@
/*
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
/* Handedness. */
#define MASTER_RIGHT

View file

@ -0,0 +1,29 @@
{
"keyboard_name": "TBK Mini Elite-C",
"usb": {
"device_version": "2.0.0"
},
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"rgb_matrix": true
},
"ws2812": {
"pin": "D3"
},
"rgb_matrix": {
"driver": "ws2812"
},
"matrix_pins": {
"cols": ["F6", "F5", "B6", "D7", "E6", "B4"],
"rows": ["F7", "C6", "D4", "B5"]
},
"diode_direction": "ROW2COL",
"split": {
"enabled": true,
"soft_serial_pin": "D2"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu"
}

View file

@ -0,0 +1 @@
AUDIO_SUPPORTED = no # Audio is not supported

View file

@ -0,0 +1,31 @@
/*
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
/* Handedness. */
#define MASTER_RIGHT
// To use the handedness pin, resistors need to be installed on the adapter PCB.
// If so, uncomment the following code, and undefine MASTER_RIGHT above.
// #define SPLIT_HAND_PIN GP13
// #define SPLIT_HAND_PIN_LOW_IS_LEFT // High -> right, Low -> left.
/* Reset. */
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U

View file

@ -0,0 +1,30 @@
{
"keyboard_name": "TBK Mini Splinky",
"usb": {
"device_version": "2.0.0"
},
"features": {
"bootmagic": true,
"mousekey": false,
"extrakey": true,
"rgb_matrix": true
},
"rgb_matrix": {
"driver": "ws2812"
},
"matrix_pins": {
"cols": ["GP27", "GP28", "GP15", "GP6", "GP7", "GP8"],
"rows": ["GP26", "GP5", "GP4", "GP9"]
},
"diode_direction": "ROW2COL",
"split": {
"enabled": true,
"soft_serial_pin": "GP1"
},
"ws2812": {
"pin": "GP0",
"driver": "vendor"
},
"processor": "RP2040",
"bootloader": "rp2040"
}

View file

@ -0,0 +1,5 @@
# Splinky controller
The splinky is a Pro-Micro/Elite-C replacement with USB-C and RP2040.
See [plut0nium/0xB2](https://github.com/plut0nium/0xB2/#releases) to figure out the right version for you (v2 or v3).

View file

@ -0,0 +1,3 @@
AUDIO_SUPPORTED = no # Audio is not supported
SERIAL_DRIVER = vendor

View file

@ -0,0 +1,31 @@
/*
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
/* Handedness. */
// #define MASTER_RIGHT
// To use the handedness pin, resistors need to be installed on the adapter PCB.
// If so, uncomment the following code, and undefine MASTER_RIGHT above.
// #define SPLIT_HAND_PIN GP15
// #define SPLIT_HAND_PIN_LOW_IS_LEFT // High -> right, Low -> left.
/* Reset. */
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U

View file

@ -0,0 +1,30 @@
{
"keyboard_name": "TBK Mini Splinky",
"usb": {
"device_version": "2.0.0"
},
"features": {
"bootmagic": true,
"mousekey": false,
"extrakey": true,
"rgb_matrix": true
},
"rgb_matrix": {
"driver": "ws2812"
},
"matrix_pins": {
"cols": ["GP27", "GP28", "GP21", "GP6", "GP7", "GP8"],
"rows": ["GP26", "GP5", "GP4", "GP9"]
},
"diode_direction": "ROW2COL",
"split": {
"enabled": true,
"soft_serial_pin": "GP1"
},
"ws2812": {
"pin": "GP0",
"driver": "vendor"
},
"processor": "RP2040",
"bootloader": "rp2040"
}

View file

@ -0,0 +1,5 @@
# Splinky controller
The splinky is a Pro-Micro/Elite-C replacement with USB-C and RP2040.
See [plut0nium/0xB2](https://github.com/plut0nium/0xB2/#releases) to figure out the right version for you (v2 or v3).

View file

@ -0,0 +1,3 @@
AUDIO_SUPPORTED = no # Audio is not supported
SERIAL_DRIVER = vendor

View file

@ -0,0 +1,38 @@
/*
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
/* Handedness. */
#define MASTER_RIGHT
// To use the handedness pin, resistors need to be installed on the adapter PCB.
// If so, uncomment the following code, and undefine MASTER_RIGHT above.
// #define A0 PAL_LINE(GPIOA, 0)
// #define SPLIT_HAND_PIN A0
// #define SPLIT_HAND_PIN_LOW_IS_LEFT // High -> right, Low -> left.
/* RGB settings. */
#define WS2812_PWM_DRIVER PWMD2
#define WS2812_PWM_CHANNEL 4
#define WS2812_PWM_PAL_MODE 1
#define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM7
#define WS2812_PWM_DMA_CHANNEL 3
/* CRC. */
#define CRC8_USE_TABLE
#define CRC8_OPTIMIZE_SPEED

View file

@ -0,0 +1,23 @@
/*
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
#define HAL_USE_PWM TRUE
#define HAL_USE_SERIAL TRUE
#include_next <halconf.h>

View file

@ -0,0 +1,32 @@
{
"keyboard_name": "TBK Mini STeMCell",
"usb": {
"device_version": "2.0.0"
},
"features": {
"bootmagic": true,
"mousekey": true,
"extrakey": true,
"rgb_matrix": true
},
"rgb_matrix": {
"driver": "ws2812"
},
"ws2812": {
"pin": "A2",
"driver": "pwm"
},
"build": {
"debounce_type": "asym_eager_defer_pk"
},
"matrix_pins": {
"cols": ["B1", "B2", "A4", "B4", "B5", "B8"],
"rows": ["B0", "B3", "A15", "B9"]
},
"diode_direction": "ROW2COL",
"split": {
"enabled": true,
"soft_serial_pin": "A3"
},
"development_board": "stemcell"
}

View file

@ -0,0 +1,29 @@
/*
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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/>.
*/
#pragma once
#include_next <mcuconf.h>
#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 FALSE
#undef STM32_PWM_USE_TIM2
#define STM32_PWM_USE_TIM2 TRUE
#undef STM32_ST_USE_TIMER
#define STM32_ST_USE_TIMER 5

View file

@ -0,0 +1,3 @@
AUDIO_SUPPORTED = no # Audio is not supported
SERIAL_DRIVER = usart

36
readme.md Normal file
View file

@ -0,0 +1,36 @@
# Included Keyboards
QMK runs on a diverse range of keyboards. Some of these keyboards are well maintained and see constant community contributions, while others are part of the repository for historical reasons.
## Official QMK Keyboards
### Ortholinear Keyboards - Jack Humbert
What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and killer tactile feel. These are available through [olkb.com](http://olkb.com) as well as through [Massdrop](http://massdrop.com) from time to time, as easy to assemble kits.
* [Planck](/keyboards/planck/) &mdash; A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine.
* [Preonic](/keyboards/preonic/) &mdash; Like the Planck, but bigger. 50%.
* [Atomic](/keyboards/atomic/) &mdash; Imagine the size of the Planck. Now imagine the size of the Preonic. Now imagine _bigger_. That is the Atomic. A 60% keyboard.
### Clueboard - Zach White
Designed and built in Felton, CA, Clueboards keyboard emphasize quality and locally sourced components.
* [Clueboard](/keyboards/clueboard/66/) &mdash; The 66% custom keyboard.
* [Cluecard](/keyboards/clueboard/card/) &mdash; A small board to help you hack on QMK.
* [Cluepad](/keyboards/clueboard/17/) &mdash; A mechanical numpad with QMK superpowers.
### Moonlander, ErgoDox EZ and Planck EZ - ZSA Technology Labs
[ZSA Technology Labs](https://zsa.io) maintains its own [fork of QMK](https://github.com/zsa/qmk_firmware) which feeds its [configurator](https://configure.zsa.io), for stability and legal purposes. The ZSA boards are:
* [Moonlander Mark I](/keyboards/moonlander/) &mdash; A next-gen split, ergonomic keyboard with an active left side, USB type C, integrated wrist rest, and a thumb cluster that can move.
* [ErgoDox EZ](/keyboards/ergodox_ez/) &mdash; A powerful split mechanical keyboard.
* [Planck EZ](/keyboards/planck/ez) &mdash; A 40% DIY powerhouse of customizability and modification capability. It's a lean, mean, typing machine, which ships fully assembled with a two-year warranty.
## Community-supported QMK Keyboards
These keyboards are part of the QMK repository, but their manufacturers are not official maintainers of the repository.
Since there are too many to list here and keep updated, please see the folder listing instead.