Skip to content

Commit

Permalink
Commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebritto committed Jan 21, 2025
1 parent b908a97 commit b500c67
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions config/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <behaviors/num_word.dtsi> // requires auto-layer module (https://github.com/urob/zmk-auto-layer)
#include "mouse.dtsi"

// Layer defines

#define DEF 0
#define MOU 1
#define NUM 2
Expand All @@ -16,6 +18,8 @@

#define HYPER LG(LS(LC(LALT))) // HYPER key for another shortcut layer

// Customizing behaviors

&sk {
quick-release; // Avoids "THis" problem (double capitalization)
release-after-ms = <86400000>;// Default is 1000 ms, raised to 1 day to emulate Callum's behavior that requires canceling on layer key.
Expand All @@ -25,7 +29,7 @@

&mt { flavor = "balanced"; };

&num_word {
&num_word { // requires auto-layer module (https://github.com/urob/zmk-auto-layer)
continue-list = <COLON KP_DOT COMMA PLUS MINUS ASTRK SLASH EQUAL AT DOLLAR BSPC DEL TAB KP_ENTER ESC LPAR RPAR LBKT RBKT LBRC RBRC LT GT>;
ignore-modifiers;
};
Expand All @@ -34,7 +38,9 @@
combos {
compatible = "zmk,combos";

left_hand_esc {
// Making the keyboard more accessible for one-handed use

left_hand_esc { // Left hand is great to allow mouse usage simultaneously
bindings = <&kp ESCAPE>;
key-positions = <1 2 3>;
require-prior-idle-ms = <200>;
Expand All @@ -46,18 +52,20 @@
require-prior-idle-ms = <200>;
};

right_hand_enter {
bindings = <&hrmr RA(LS(RGUI)) ENTER>;
key-positions = <16 17 18>;
require-prior-idle-ms = <200>;
};

left_hand_backspace {
bindings = <&hrml LA(LGUI) BSPC>;
key-positions = <11 13>;
require-prior-idle-ms = <200>;
};

right_hand_enter { // Feels more natural to press ENTER with the right hand
bindings = <&hrmr RA(LS(RGUI)) ENTER>;
key-positions = <16 17 18>;
require-prior-idle-ms = <200>;
};

// Layer toggles and other gimmickry

toggle_nav_for_extended_edits {
key-positions = <30 31>;
bindings = <&tog NAV>;
Expand All @@ -67,7 +75,7 @@

sticky_sym_layer_for_one_handed_activation {
key-positions = <32 33>;
bindings = <&sk SYM>; // usually just one symbol is used, so a &sk is better than &tog
bindings = <&sl SYM>; // usually just one symbol is used, so a &sl is better than &tog
require-prior-idle-ms = <200>;
layers = <DEF SYM>;
};
Expand Down Expand Up @@ -97,12 +105,14 @@
require-prior-idle-ms = <200>;
};

toggle_aoe {
toggle_aoe_gaming_layer {
key-positions = <20 21 22>;
bindings = <&tog AOE>;
layers = <NAV AGS>;
require-prior-idle-ms = <200>;
};

// SYS combos to replace a dedicated SYS layer

sys_bootloader {
key-positions = <20 21>;
Expand All @@ -123,13 +133,13 @@
layers = <FUN>;
};

sys_connect_to_bt2 {
sys_connect_to_bt2 { // Further devices can be added up to 6, but these feel enough to me
key-positions = <23 24>;
bindings = <&bt BT_SEL 2>;
layers = <FUN>;
};

sys_clear_current_bluetooth_profile {
sys_clear_current_bluetooth_profile { // Required to completely unpair from a device
key-positions = <28 29>;
bindings = <&bt BT_CLR>;
layers = <FUN>;
Expand Down Expand Up @@ -163,18 +173,8 @@

mods = <(MOD_LCTL)>;
};

hp: hold_preferred_mod_tap { // Allows for space/shift+space for scrolling up with the left hand on the keyboard and the right one on the mouse
compatible = "zmk,behavior-hold-tap";
label = "THUMB_SHIFT";
bindings = <&kp>, <&kp>;

#binding-cells = <2>;
flavor = "hold-preferred";
tapping-term-ms = <150>;
quick-tap-ms = <175>;
hold-while-undecided;
};

// Swapper for Apple's CMD+TAB behavior

swapper: swapper_for_apple_cmd_tab {
compatible = "zmk,behavior-tri-state"; // requires tri-state module (https://github.com/urob/zmk-tri-state)
Expand All @@ -184,7 +184,9 @@
ignored-key-positions = <7 16 17 18 9 19 29>; // Arrows and BSPC, ENTER and DEL for alt-tab movement and window/app controls
};

hrml: hrml {
// Customized hold-tap definitions

hrml: hrml { // urob's home row mods left
compatible = "zmk,behavior-hold-tap";
label = "HRML";
bindings = <&kp>, <&kp>;
Expand All @@ -198,7 +200,7 @@
require-prior-idle-ms = <175>;
};

hrmr: hrmr {
hrmr: hrmr { // urob's home row mods right
compatible = "zmk,behavior-hold-tap";
label = "HRMR";
bindings = <&kp>, <&kp>;
Expand Down

0 comments on commit b500c67

Please sign in to comment.