1
0
mirror of https://github.com/tcaxle/zmk-config.git synced 2024-11-21 23:01:55 +00:00
zmk-config/config/sofle.keymap
2023-10-17 14:02:35 +00:00

169 lines
9.8 KiB
C

/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/rgb.h>
#define BASE 0
#define LOWER 1
#define RAISE 2
#define ADJUST 3
/ {
// Activate ADJUST layer by pressing raise and lower
conditional_layers {
compatible = "zmk,conditional-layers";
adjust_layer {
if-layers = <2 4>;
then-layer = <5>;
};
};
behaviors {
htog: htog {
compatible = "zmk,behavior-hold-tap";
label = "HTOG";
bindings = <&mo>, <&tog>;
#binding-cells = <2>;
tapping-term-ms = <300>;
};
};
keymap {
compatible = "zmk,keymap";
base {
label = "base";
// ------------------------------------------------------------------------------------------------------------
// | ` | 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 |
bindings = <
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &none
&kp ESC &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &none
&kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp DEL
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &trans &kp K_MUTE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
&kp LCTRL &kp LEFT_WIN &kp LALT &htog 1 2 &kp RET &kp SPACE &mo 4 &kp RALT &kp RIGHT_WIN &kp RCTRL
>;
sensor-bindings =
<&inc_dec_kp C_AC_SCROLL_UP C_AC_SCROLL_DOWN>,
<&inc_dec_kp C_VOLUME_UP C_VOL_DN>;
};
mirror {
bindings = <
&trans &kp N0 &kp N9 &kp N8 &kp N7 &kp N6 &trans &trans &trans &trans &trans &trans
&trans &kp SEMI &kp Y &kp U &kp L &kp J &trans &trans &trans &trans &trans &trans
&kp DEL &kp O &kp I &kp E &kp N &kp H &trans &trans &trans &trans &trans &trans
&trans &kp FSLH &kp DOT &kp COMMA &kp M &kp K &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
label = "mirror";
};
left-keypad {
label = "left-keypad";
// 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 = <
&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
&kp GRAVE &kp KP_DIVIDE &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MULTIPLY &none &none &none &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &none
&kp DELETE &kp KP_SUBTRACT &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &none &none &none &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp BACKSPACE
&lt 6 LSHIFT &kp KP_N0 &kp KP_N1 &kp KP_NUMBER_2 &kp KP_N3 &kp KP_DOT &tog 3 &none &none &kp PG_DN &kp UP &kp PG_UP &kp BSLH &none
&none &none &none &tog 2 &trans &trans &none &kp LEFT &kp DOWN &kp RIGHT
>;
sensor-bindings =
<&inc_dec_kp RIGHT LEFT>,
<&inc_dec_kp PG_UP PG_DN>;
};
alt-encoder-nav {
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
>;
sensor-bindings = <&inc_dec_kp UP_ARROW DOWN>;
};
right-mod {
label = "right-mod";
// ------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | | INS | PSCR | GUI | | | | PGUP | | ^ | | | |
// | | ALT | CTRL | SHIFT | | CAPS | | PGDN | <- | v | -> | DEL | BKSPC |
// | | UNDO | CUT | COPY | PASTE | | | | | | | | | | |
// | | | | | | | | | | | |
bindings = <
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none
&none &kp INS &kp PSCRN &kp K_CMENU &none &none &none &none &none &none &none &none
&kp DELETE &kp LALT &kp LCTRL &kp LSHFT &none &kp CLCK &none &none &none &none &none &kp BSPC
&none &kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
both-mod {
// ----------------------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | EXTPWR | RGB_HUD | RGB_HUI | RGB_SAD | RGB_SAI | RGB_EFF | | | | | | | |
// | | RGB_BRD | RGB_BRI | | | | | | | | | | |
// | | | | | | | RGB_TOG | | | | | | | | |
// | | | | | | | | | | | |
label = "both-mod";
bindings = <
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none
&ext_power EP_TOG &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &none &none &none &none &none
&none &rgb_ug RGB_BRD &rgb_ug RGB_BRI &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &rgb_ug RGB_TOG &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none
>;
sensor-bindings = <&inc_dec_kp 0 0>;
};
layer_4 {
bindings = <
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &kp PG_UP &kp UP_ARROW &kp PG_DN &none &none &none &none &none &none &none
&none &kp HOME &kp UP &kp DOWN &kp RIGHT &kp END &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none
>;
sensor-bindings = <&inc_dec_kp UP_ARROW DOWN>;
};
};
};