Files
sofle-v2-oled-zmk/config/sofle.keymap

156 lines
12 KiB
Plaintext
Raw Normal View History

2025-03-26 05:30:42 +00:00
/*
2023-11-10 14:26:22 +07:00
* 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>
2024-09-06 15:18:32 +00:00
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/rgb.h>
#include <zmk-helpers/helper.h>
#include <zmk-helpers/key-labels/sofle.h>
2023-11-10 14:26:22 +07:00
#define BASE 0
#define LOWER 1
#define RAISE 2
#define ADJUST 3
#define KEYS_L LN0 LN1 LN2 LN3 LN4 LN5 LT0 LT1 LT2 LT3 LT4 LT5 LM0 LM1 LM2 LM3 LM4 LM5 LB0 LB1 LB2 LB3 LB4 LB5 // Left-hand keys.
#define KEYS_R RN0 RN1 RN2 RN3 RN4 RN5 RT0 RT1 RT2 RT3 RT4 RT5 RM0 RM1 RM2 RM3 RM4 RM5 RB0 RB1 RB2 RB3 RB4 RB5 // Right-hand keys.
#define THUMBS LH4 LH3 LH2 LH1 LH0 RH0 RH1 RH2 RH3 RH4 // Thumb keys.
2023-11-10 14:26:22 +07:00
/ {
2024-09-06 15:18:32 +00:00
// Activate ADJUST layer by pressing raise and lower
2023-11-10 14:26:22 +07:00
conditional_layers {
compatible = "zmk,conditional-layers";
2024-09-06 15:18:32 +00:00
2023-11-10 14:26:22 +07:00
adjust_layer {
if-layers = <LOWER RAISE>;
then-layer = <ADJUST>;
};
};
2025-03-26 11:56:56 -04:00
behaviors {
mt: mod_tap {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
2025-03-26 14:57:52 -04:00
flavor = "tap-preferred";
tapping-term-ms = <300>;
2025-03-26 11:56:56 -04:00
bindings = <&kp>, <&kp>;
display-name = "Mod-Tap";
};
hml: home_row_mod_left {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "balanced";
require-prior-idle-ms = <150>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_R THUMBS>; // List of keys on the right side of the keyboard
hold-trigger-on-release;
};
hmr: home_row_mod_right {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
flavor = "balanced";
require-prior-idle-ms = <150>;
tapping-term-ms = <280>;
quick-tap-ms = <175>;
bindings = <&kp>, <&kp>;
hold-trigger-key-positions = <KEYS_L THUMBS>; // List of keys on the left side of the keyboard
hold-trigger-on-release;
};
2025-03-26 11:56:56 -04:00
};
2023-11-10 14:26:22 +07:00
keymap {
compatible = "zmk,keymap";
default_layer {
label = "default";
2024-09-06 15:18:32 +00:00
2023-11-10 14:26:22 +07:00
bindings = <
//╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
&kp BSPC &kp Q &kp W &kp E &kp R &mt LBRC T &mt RBRC Y &kp U &kp I &kp O &kp P &kp BSLH
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
&mt RBRC LBRC &hml LGUI A &hml LALT S &hml LSHIFT D &hml LCTRL F &mt HOME G &mt END H &hmr RCTRL J &hmr RSHIFT K &hmr RALT L &hmr LGUI SEMI &kp SQT
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
2025-08-06 17:08:26 -04:00
&mt RBKT LBKT &kp Z &kp X &kp C &kp V &mt LBKT B &kp LGUI &kp LG(LS(S)) &mt RBKT N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
//├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤
&kp EQUAL &kp LC(F12) &kp LALT &mo LOWER &kp SPACE &kp RET &mo RAISE &kp TAB &kp DEL &kp ESC
// ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────┴─────────────┴─────────────╯
2023-11-10 14:26:22 +07:00
>;
2025-03-26 05:30:42 +00:00
sensor-bindings =
<&inc_dec_kp LEFT RIGHT>,
<&inc_dec_kp DOWN UP>;
2023-11-10 14:26:22 +07:00
};
lower_layer {
label = "lower";
2024-09-06 15:18:32 +00: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 |
// | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | |
// | | = | - | + | { | } | | | | [ | ] | ; | : | \ | |
// | | | | | | | | | | | |
2023-11-10 14:26:22 +07:00
bindings = <
2025-03-26 05:30:42 +00:00
&studio_unlock &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F12
&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp PIPE
&trans &kp EQUAL &kp MINUS &kp KP_PLUS &kp LBRC &kp RBRC &trans &trans &kp LBKT &kp RBKT &kp SEMI &kp COLON &kp BSLH &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2023-11-10 14:26:22 +07:00
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
raise_layer {
label = "raise";
2024-09-06 15:18:32 +00:00
// ------------------------------------------------------------------------------------------------------------
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
// | | INS | PSCR | GUI | | | | PGUP | | ^ | | | |
// | | ALT | CTRL | SHIFT | | CAPS | | PGDN | <- | v | -> | DEL | BKSPC |
// | | UNDO | CUT | COPY | PASTE | | | | | | | | | | |
// | | | | | | | | | | | |
2023-11-10 14:26:22 +07:00
bindings = <
2024-09-06 15:18:32 +00:00
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans
&trans &kp INS &kp PSCRN &kp K_CMENU &trans &trans &kp PG_UP &trans &kp UP &trans &kp N0 &trans
&trans &kp LALT &kp LCTRL &kp LSHFT &trans &kp CLCK &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DEL &kp BSPC
&trans &kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
2023-11-10 14:26:22 +07:00
>;
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
adjust_layer {
2024-09-06 15:18:32 +00: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-11-10 14:26:22 +07:00
label = "adjust";
bindings = <
2024-09-06 15:18:32 +00:00
&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
2023-11-10 14:26:22 +07:00
>;
};
};
};