zmk/app/boards/shields/mercury/mercury.keymap
2021-10-13 23:33:03 +00:00

127 lines
5.9 KiB
Text

#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/outputs.h>
#define APL 0
#define WIN 1
#define NUM 2
#define FUN 3
#define NAV 4
#define MED 5
#define SYS 6
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Keymap Version: Oct 13, 2021 4:30 pm
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/ {
behaviors {
m_ht: menu_key_hold_tap {
compatible = "zmk,behavior-hold-tap";
label = "MENU_KEY_HOLD_TAP";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <200>;
bindings = <&kp>, <&kp>;
};
hlt: hold_preferred_layer_tap {
compatible = "zmk,behavior-hold-tap";
label = "HOLD_PREFERRED_LAYER_TAP";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <200>;
bindings = <&mo>, <&kp>;
};
// For regular, hold-preferred, hold-tap behaviors, a shorter tapping term
// encourages hold-decisions. This is because an expiring tapping term forces
// the behavior to decide as a hold.
//
// However, for conditional, hold-preferred, hold-tap behaviors, a shorter
// tapping term actually encourages tap-decisions. This is because a shorter
// tapping term gives the user less time to press one of the conditional
// hold-enabler-keys that are required to enable a hold-decision.
// Furthermore, if the tapping-term expires before the user manages to press
// a hold-enabler-key, the expiring tapping-term timer also directly triggers
// the behavior to decide as a tap.
cmt: c_mod_tap {
compatible = "zmk,behavior-hold-tap";
label = "CONDITIONAL_HOLD_TAP";
#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <50>;
bindings = <&kp>, <&kp>;
hold-enabler-keys = <0 12>;
};
};
keymap {
compatible = "zmk,keymap";
apple_layer {
bindings = <
&hlt FUN TAB &cmt LSFT Q &kp W &kp E &kp R &kp T /**/ &kp Y &kp U &kp I &kp O &kp P &kp BKSP
&hlt NUM ESC &kp A &kp S &kp D &cmt LSFT F &kp G /**/ &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT
&kp LSFT &kp Z &kp X &kp C &kp V &kp B /**/ &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT
&kp LCTL &kp LALT &m_ht LGUI K_CMENU /**/ &kp SPC &hlt NAV RET &mo MED
>;
};
windows_layer {
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
&kp LGUI &kp LALT &m_ht LCTL K_CMENU /**/ &trans &trans &trans
>;
};
num_layer {
bindings = <
//
&mo SYS &kp LSFT &trans &trans &trans &trans /**/ &trans &kp NUM_7 &kp NUM_8 &kp NUM_9 &trans &trans
&trans &trans &kp GRAV &kp TILDE &kp LSFT &trans /**/ &kp EQL &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp LBKT &kp RBKT
&trans &trans &trans &trans &trans &trans /**/ &kp MINUS &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp BSLH &trans
&trans &trans &trans /**/ &trans &kp NUM_0 &trans
>;
};
function_layer {
bindings = <
&trans &kp LSFT &trans &trans &trans &trans /**/ &kp F12 &kp F7 &kp F8 &kp F9 &trans &trans
&mo SYS &trans &trans &trans &kp LSFT &trans /**/ &kp F11 &kp F4 &kp F5 &kp F6 &kp LBKT &kp RBKT
&trans &trans &trans &trans &trans &trans /**/ &kp F10 &kp F1 &kp F2 &kp F3 &trans &trans
&trans &trans &trans /**/ &trans &trans &trans
>;
};
nav_layer {
bindings = <
&trans &trans &trans &trans &trans &trans /**/ &trans &trans &kp UARW &kp PGUP &kp PRSC &kp DEL
&trans &trans &kp SLCK &trans &trans &trans /**/ &trans &kp LARW &kp DARW &kp RARW &trans &trans
&trans &trans &trans &kp CLCK &trans &kp PAUSE_BREAK /**/ &kp INS &kp PGDN &kp HOME &kp END &trans &trans
&trans &trans &trans /**/ &trans &trans &trans
>;
};
media_layer {
bindings = <
&trans &trans &to WIN &trans &trans &trans /**/ &trans &trans &kp C_VOL_UP &trans &trans &trans
&trans &to APL &trans &trans &trans &trans /**/ &trans &kp C_BRI_DN &kp C_VOL_DN &kp C_BRI_UP &trans &trans
&trans &trans &trans &trans &trans &trans /**/ &trans &kp C_MUTE &trans &trans &trans &trans
&trans &kp RALT &trans /**/ &trans &trans &trans
>;
};
system_layer {
bindings = <
&trans &trans &to WIN &trans &reset &trans /**/ &trans &trans &trans &trans &trans &trans
&trans &to APL &out OUT_USB &trans &trans &trans /**/ &trans &trans &trans &trans &trans &trans
&trans &trans &trans &bt BT_CLR &trans &out OUT_BLE /**/ &trans &trans &trans &trans &trans &trans
&bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 /**/ &trans &trans &trans
>;
};
};
};