1
0
mirror of https://github.com/tcaxle/zmk-config.git synced 2024-11-24 00:02:00 +00:00
zmk-config/config/sofle.keymap

198 lines
9.2 KiB
C
Raw Permalink Normal View History

2023-10-17 12:25:40 +01:00
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
2023-10-17 15:02:35 +01:00
#include <dt-bindings/zmk/keys.h>
2023-10-17 12:25:40 +01:00
#define BASE 0
#define LOWER 1
#define RAISE 2
#define ADJUST 3
/ {
2023-10-17 15:02:35 +01:00
// Activate ADJUST layer by pressing raise and lower
2023-10-17 12:25:40 +01:00
2023-10-29 19:44:07 +00:00
left_encoder: encoder_left {
compatible = "alps,ec11";
label = "LEFT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
};
2024-01-10 10:36:57 +00:00
2023-10-29 19:44:07 +00:00
right_encoder: encoder_right {
compatible = "alps,ec11";
label = "RIGHT_ENCODER";
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
steps = <80>;
};
sensors {
compatible = "zmk,keymap-sensors";
sensors = <&left_encoder &right_encoder>;
triggers-per-rotation = <20>;
};
2024-02-26 16:22:49 +00:00
conditional_layers { compatible = "zmk,conditional-layers"; };
2023-10-17 15:02:35 +01:00
behaviors {
2024-02-27 09:54:19 +00:00
mtd: mtd {
2024-01-10 10:36:57 +00:00
compatible = "zmk,behavior-tap-dance";
2024-02-27 09:57:59 +00:00
label = "Mod-Tap-Dance";
2024-01-10 10:36:57 +00:00
#binding-cells = <0>;
2024-08-07 10:16:35 +01:00
bindings = <&mo 2>, <&tog 3>;
2024-01-10 10:36:57 +00:00
};
2024-02-27 13:32:57 +00:00
shift_caps_l: shift_caps_l {
compatible = "zmk,behavior-tap-dance";
label = "SHIFT_CAPS_L";
#binding-cells = <0>;
2024-10-24 09:59:02 +01:00
bindings = <&kp LSHFT>, <&kp CAPS>;
2024-02-27 13:32:57 +00:00
};
shift_caps_r: shift_caps_r {
compatible = "zmk,behavior-tap-dance";
label = "SHIFT_CAPS_R";
#binding-cells = <0>;
2024-10-24 09:59:02 +01:00
bindings = <&kp RSHFT>, <&kp CAPS>;
2024-02-27 13:32:57 +00:00
};
2024-02-28 11:18:05 +00:00
hlt: hlt {
compatible = "zmk,behavior-hold-tap";
label = "HLT";
2024-02-28 11:33:46 +00:00
bindings = <&mo>, <&kp>;
2024-02-28 11:18:05 +00:00
#binding-cells = <2>;
tapping-term-ms = <200>;
2024-02-28 11:25:41 +00:00
flavor = "hold-preferred";
2024-02-28 11:33:46 +00:00
retro-tap;
2024-02-28 11:18:05 +00:00
};
2024-08-07 10:16:35 +01:00
th: th {
compatible = "zmk,behavior-hold-tap";
label = "TH";
bindings = <&kp>, <&kp>;
#binding-cells = <2>;
flavor = "tap-preferred";
tapping-term-ms = <300>;
};
2023-10-18 10:54:52 +01:00
};
combos {
compatible = "zmk,combos";
qwerty {
2024-02-27 10:57:58 +00:00
bindings = <&tog 4>;
2023-10-18 10:54:52 +01:00
key-positions = <57 58 59>;
};
2023-10-29 19:11:59 +00:00
2024-02-27 09:51:08 +00:00
L_ENTER {
2024-02-26 16:22:49 +00:00
bindings = <&kp ENTER>;
key-positions = <14 15>;
};
2024-02-27 09:51:08 +00:00
R_SPACE {
bindings = <&kp SPACE>;
2024-08-06 10:50:49 +01:00
key-positions = <46 47>;
};
L_SPACE {
bindings = <&kp SPACE>;
key-positions = <38 39>;
};
R_ENTER {
bindings = <&kp ENTER>;
key-positions = <21 20>;
2023-10-30 10:52:59 +00:00
};
};
2023-10-17 12:25:40 +01:00
keymap {
compatible = "zmk,keymap";
2023-10-17 15:02:35 +01:00
base {
2024-02-27 10:57:58 +00:00
label = "Base";
2023-10-17 15:02:35 +01:00
// ------------------------------------------------------------------------------------------------------------
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC |
// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT |
// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI |
2023-10-17 12:25:40 +01:00
bindings = <
2024-08-07 10:16:35 +01:00
&th F12 ESCAPE &th F1 N1 &th F2 N2 &th F3 N3 &th F4 N4 &th F5 N5 &th F6 N6 &th F7 N7 &th F8 N8 &th F9 N9 &th F10 N0 &th F11 MINUS
&kp TAB &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &kp GRAVE
&kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp SINGLE_QUOTE
&shift_caps_l &kp Z &kp X &kp C &kp V &kp B &kp C_MUTE &kp C_PLAY_PAUSE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &shift_caps_r
2024-10-24 09:59:02 +01:00
&kp LCTRL &kp LEFT_WIN &kp LALT &mtd &mo 1 &mo 1 &mtd &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL
2023-10-17 12:25:40 +01:00
>;
2024-11-15 14:44:22 +00:00
sensor-bindings =
<&inc_dec_kp C_VOL_DN C_VOLUME_UP>,
<&inc_dec_kp K_SCROLL_DOWN K_SCROLL_UP>;
2023-10-17 12:25:40 +01:00
};
2024-02-27 09:51:08 +00:00
mirrored {
bindings = <
2024-08-07 10:16:35 +01:00
&th F11 MINUS &th F10 N0 &th F9 N9 &th F8 N8 &th F7 N7 &th F6 N6 &th F5 N5 &th F4 N4 &th F3 N3 &th F2 N2 &th F1 N1 &th F12 ESCAPE
&kp GRAVE &kp SEMI &kp Y &kp U &kp L &kp J &kp G &kp P &kp F &kp W &kp Q &kp TAB
&kp SQT &kp O &kp I &kp E &kp N &kp H &kp D &kp T &kp S &kp R &kp A &kp BSPC
2024-10-24 09:59:02 +01:00
&kp LEFT_SHIFT &kp FSLH &kp DOT &kp COMMA &kp M &kp K &kp C_PLAY_PAUSE &kp C_MUTE &kp B &kp V &kp C &kp X &kp Z &kp RIGHT_SHIFT
&kp RCTRL &kp RGUI &kp RALT &trans &trans &trans &trans &kp LALT &kp LGUI &kp LCTRL
2024-02-27 09:51:08 +00:00
>;
label = "Mirrored";
};
mod_a {
2024-03-20 11:37:07 +00:00
bindings = <
2024-08-07 10:16:35 +01:00
&kp EQUAL &kp LBKT &kp RBKT &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
2024-03-20 11:37:07 +00:00
&kp NON_US_HASH &none &none &none &none &none &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &kp KP_ASTERISK &kp KP_DIVIDE &kp NON_US_HASH
2024-10-24 09:59:02 +01:00
&kp DELETE &kp INS &kp HOME &kp UP &kp END &kp PG_UP &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp KP_PLUS &kp KP_MINUS &kp BACKSPACE
2024-07-30 11:19:33 +01:00
&kp LSHIFT &kp NUBS &kp LEFT &kp DOWN &kp RIGHT &kp PAGE_DOWN &trans &trans &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &kp KP_DOT &kp KP_EQUAL &kp RSHIFT
2024-03-20 11:37:07 +00:00
&trans &trans &trans &trans &trans &trans &trans &kp KP_NUMBER_0 &trans &trans
>;
2024-02-27 09:51:08 +00:00
label = "Mod A";
2024-03-20 11:37:07 +00:00
};
mod_b {
label = "Mod b";
2023-10-17 15:02:35 +01:00
// TODO: Some binds are waiting for shifted keycode support.
// ------------------------------------------------------------------------------------------------------------
// | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
// | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | |
// | | = | - | + | { | } | | | | [ | ] | ; | : | \ | |
// | | | | | | | | | | | |
bindings = <
2024-08-07 10:16:35 +01:00
&kp EQUAL &kp LEFT_BRACKET &kp RIGHT_BRACKET &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
2024-03-20 11:37:07 +00:00
&kp KP_NUMLOCK &kp KP_DIVIDE &kp KP_MULTIPLY &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &none &none &none &none &none &kp NON_US_HASH
2024-10-24 09:59:02 +01:00
&kp BACKSPACE &kp KP_SUBTRACT &kp KP_PLUS &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp PG_UP &kp HOME &kp UP &kp END &kp INS &kp DELETE
2024-07-30 11:21:19 +01:00
&kp LEFT_SHIFT &kp KP_EQUAL &kp KP_DOT &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &trans &trans &kp PAGE_DOWN &kp LEFT &kp DOWN &kp RIGHT &kp NUBS &kp RIGHT_SHIFT
2024-08-07 10:16:35 +01:00
&trans &trans &kp KP_N0 &tog 3 &trans &trans &tog 3 &trans &trans &trans
2023-10-17 12:25:40 +01:00
>;
};
2024-02-27 09:51:08 +00:00
qwerty {
2024-02-26 16:22:49 +00:00
bindings = <
2024-07-30 11:21:19 +01:00
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &trans
&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &trans
&kp LEFT_SHIFT &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RIGHT_SHIFT
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2024-02-26 16:22:49 +00:00
>;
2024-02-27 09:51:08 +00:00
label = "QWERTY";
2024-02-26 16:22:49 +00:00
};
2023-10-17 12:25:40 +01:00
};
};