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

219 lines
11 KiB
C
Raw 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>;
};
2023-10-17 12:25:40 +01:00
conditional_layers {
compatible = "zmk,conditional-layers";
2023-10-17 15:02:35 +01:00
};
behaviors {
2024-01-10 10:36:57 +00:00
mirror_mod: mirror_mod {
compatible = "zmk,behavior-tap-dance";
label = "MIRROR_MOD";
#binding-cells = <0>;
bindings = <&mo 6>, <&mo 1>, <&mo 7>;
};
2023-10-18 10:54:52 +01:00
};
combos {
compatible = "zmk,combos";
2024-01-10 10:36:57 +00:00
mirror {
2024-01-10 10:53:10 +00:00
bindings = <&tog 5>;
2023-10-18 10:54:52 +01:00
key-positions = <50 51 52>;
};
qwerty {
2024-01-10 10:36:57 +00:00
bindings = <&tog 3>;
2023-10-18 10:54:52 +01:00
key-positions = <57 58 59>;
};
2023-10-29 19:11:59 +00:00
2023-10-29 20:15:48 +00:00
conf {
bindings = <&sl 2>;
key-positions = <53 56>;
2023-10-29 19:11:59 +00:00
};
2023-10-17 12:25:40 +01:00
};
2023-10-30 10:52:59 +00:00
macros {
double_vol_up: double_vol_up {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&key_repeat>;
label = "DOUBLE_VOL_UP";
};
};
2023-10-17 12:25:40 +01:00
keymap {
compatible = "zmk,keymap";
2023-10-17 15:02:35 +01:00
base {
2023-10-30 10:33:43 +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 = <
2023-10-30 10:29:38 +00:00
&kp ESCAPE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
2023-11-01 13:48:56 +00:00
&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
2024-01-10 10:36:57 +00:00
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &tog 4 &kp C_MUTE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
2023-10-30 10:29:38 +00:00
&kp LCTRL &kp LEFT_WIN &kp LALT &mo 1 &kp SPACE &kp ENTER &mo 1 &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL
2023-10-17 12:25:40 +01:00
>;
2023-10-17 15:02:35 +01:00
sensor-bindings =
2023-10-29 20:29:34 +00:00
<&inc_dec_kp UP_ARROW DOWN>,
2023-10-29 19:39:54 +00:00
<&inc_dec_kp C_VOL_UP C_VOL_DN>;
2023-10-17 12:25:40 +01:00
};
2023-10-29 20:15:48 +00:00
mod {
2023-10-30 10:33:43 +00:00
label = "Mod";
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 = <
2023-11-01 13:48:56 +00:00
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
&kp KP_NUMLOCK &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_N7 &kp KP_N8 &kp KP_NUMBER_9 &trans &trans &trans &trans &trans &trans
&kp DELETE &kp KP_SUBTRACT &kp KP_PLUS &kp KP_N4 &kp KP_N5 &kp KP_NUMBER_6 &kp HOME &kp PG_UP &kp UP &kp PG_DN &kp INS &kp NUHS
2023-10-31 09:17:11 +00:00
&trans &kp KP_EQUAL &kp KP_DOT &kp KP_N1 &kp KP_N2 &kp KP_NUMBER_3 &trans &trans &kp END &kp LEFT &kp DOWN &kp RIGHT &kp NUBS &trans
&trans &trans &kp KP_N0 &trans &kp ENTER &kp SPACE &trans &trans &trans &trans
2023-10-17 12:25:40 +01:00
>;
};
2023-10-29 20:15:48 +00:00
conf {
2023-10-17 15:02:35 +01:00
// ----------------------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | EXTPWR | RGB_HUD | RGB_HUI | RGB_SAD | RGB_SAI | RGB_EFF | | | | | | | |
// | | RGB_BRD | RGB_BRI | | | | | | | | | | |
// | | | | | | | RGB_TOG | | | | | | | | |
// | | | | | | | | | | | |
2023-10-30 10:33:43 +00:00
label = "Conf";
2023-10-17 12:25:40 +01:00
bindings = <
2023-10-29 20:15:48 +00:00
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &trans &trans &trans &trans &none &none &none &none &none &kp F12
&none &trans &trans &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &trans &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none
2023-10-17 12:25:40 +01:00
>;
2023-10-18 10:54:52 +01:00
};
qwerty {
2023-10-17 15:02:35 +01:00
bindings = <
2023-10-18 10:54:52 +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
&trans &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2023-10-17 15:02:35 +01:00
>;
2023-10-30 10:33:43 +00:00
label = "QWERTY";
2023-10-18 10:54:52 +01:00
};
2023-10-29 20:29:34 +00:00
left-encoder-alt {
2023-10-18 10:54:52 +01:00
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2023-10-29 20:15:48 +00:00
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2023-10-18 10:54:52 +01:00
>;
2023-10-29 20:29:34 +00:00
sensor-bindings = <&inc_dec_kp LEFT_ARROW RIGHT_ARROW>;
2023-10-30 10:33:43 +00:00
label = "Base ⬌";
2023-10-29 20:29:34 +00:00
};
2024-01-10 10:36:57 +00:00
mirror_mod {
bindings = <
2024-01-10 10:53:10 +00:00
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &mirror_mod &trans &trans &mirror_mod &trans &trans &trans
2024-01-10 10:36:57 +00:00
>;
label = "Base Unmirrored";
};
base_mirrored {
bindings = <
&kp MINUS &kp N0 &kp N9 &kp N8 &kp N7 &kp N6 &kp N5 &kp N4 &kp N3 &kp N2 &kp N1 &kp ESC
&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
&kp RSHFT &kp FSLH &kp DOT &kp COMMA &kp M &kp K &kp BSPC &kp V &kp B &kp V &kp C &kp X &kp Z &kp LSHFT
&kp RCTRL &kp RGUI &kp RALT &trans &kp RET &kp SPACE &trans &kp LALT &kp LGUI &kp LCTRL
>;
label = "Base Mirrored";
};
mod_mirrored {
bindings = <
&kp EQUAL &kp LBKT &kp RBKT &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9 &kp KP_ASTERISK &kp KP_DIVIDE &kp KP_NUMLOCK
&kp POUND &kp INS &kp PG_UP &kp UP &kp PAGE_DOWN &kp HOME &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &kp KP_PLUS &kp KP_MINUS &kp DEL
&trans &kp BSLH &kp LEFT &kp DOWN &kp RIGHT &kp END &trans &trans &kp N1 &kp N2 &kp N3 &kp KP_DOT &kp KP_EQUAL &trans
&trans &trans &trans &trans &kp SPACE &kp RET &trans &kp KP_NUMBER_0 &trans &trans
>;
label = "Mod Mirrored";
};
macro {
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
label = "Macro";
};
2023-10-17 12:25:40 +01:00
};
};