Skip to content

Commit

Permalink
Customize configuration for Dactyl Manuform 5x7
Browse files Browse the repository at this point in the history
Basis for configuration copied from alansaul:
https://github.com/alansaul/zmk-config
  • Loading branch information
trentrand committed Apr 10, 2024
1 parent dd578b9 commit 3572edc
Show file tree
Hide file tree
Showing 15 changed files with 530 additions and 53 deletions.
23 changes: 23 additions & 0 deletions boards/shields/dactyl_manuform_5x7/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if SHIELD_DACTYL_MANUFORM_5x7_LEFT

config ZMK_KEYBOARD_NAME
default "DactylL"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_DACTYL_MANUFORM_5x7_RIGHT

config ZMK_KEYBOARD_NAME
default "DactylR"

endif

if SHIELD_DACTYL_MANUFORM_5x7_LEFT || SHIELD_DACTYL_MANUFORM_5x7_RIGHT

config ZMK_SPLIT
default y

endif
5 changes: 5 additions & 0 deletions boards/shields/dactyl_manuform_5x7/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config SHIELD_DACTYL_MANUFORM_5x7_LEFT
def_bool $(shields_list_contains,dactyl_manuform_5x7_left)

config SHIELD_DACTYL_MANUFORM_5x7_RIGHT
def_bool $(shields_list_contains,dactyl_manuform_5x7_right)
Empty file.
40 changes: 40 additions & 0 deletions boards/shields/dactyl_manuform_5x7/dactyl_manuform_5x7.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <14>;
rows = <6>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,13) RC(0,12) RC(0,11) RC(0,10) RC(0,9) RC(0,8) RC(0,7)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,13) RC(1,12) RC(1,11) RC(1,10) RC(1,9) RC(1,8) RC(1,7)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,13) RC(2,12) RC(2,11) RC(2,10) RC(2,9) RC(2,8) RC(2,7)
RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,13) RC(3,12) RC(3,11) RC(3,10) RC(3,9) RC(3,8) RC(3,7)
RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,11) RC(4,10) RC(4,9) RC(4,8) RC(4,7)
RC(4,5) RC(4,6) RC(4,13) RC(4,12)
RC(5,6) RC(5,4) RC(5,11) RC(5,13)
RC(5,5) RC(5,3) RC(5,10) RC(5,12)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

};
};
91 changes: 91 additions & 0 deletions boards/shields/dactyl_manuform_5x7/dactyl_manuform_5x7.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/ext_power.h>
#include <dt-bindings/zmk/outputs.h>
#include "keys_en_gb_extended.h"

#define ZMK_MOUSE_DEFAULT_MOVE_VAL 1500 // 600
#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10

#include <dt-bindings/zmk/mouse.h>

#define BASE0 0
#define SMB1 1
#define MED2 2


/ {
macros {
vim_yank: vim_yank {
label = "ZM_vim_yank";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_tap &kp GB_DQT &kp GB_PLUS &kp Y>
;
};

vim_paste: vim_paste {
label = "ZM_vim_paste";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings
= <&macro_tap &kp GB_DQT &kp GB_PLUS &kp P>
;
};
};
behaviors {
ht_tp: hold_tap_tap_preferred {
compatible = "zmk,behavior-hold-tap";
label = "HOLD_TAP";
#binding-cells = <2>;
tapping-term-ms = <200>;
quick-tap-ms = <0>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
};
keymap {
compatible = "zmk,keymap";

base0_layer {
bindings = <
&kp GB_EQUAL &kp GB_N1 &kp GB_N2 &kp GB_N3 &kp GB_N4 &kp GB_N5 &kp LG(UP) &kp LG(DOWN) &kp GB_N6 &kp GB_N7 &kp GB_N8 &kp GB_N9 &kp GB_N0 &ht_tp GB_MINUS GB_EQUAL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp &trans &kp &trans &kp Y &kp U &kp I &kp O &kp P &ht_tp GB_HASH GB_BSLH
&kp ESC &lt MED2 A &kp S &kp D &kp F &kp G &kp LG(LEFT) &kp LG(RIGHT) &kp H &kp J &kp K &kp L &lt SMB1 GB_SEMI &mt RGUI GB_SQT
&kp LSHFT &mt LCTRL Z &kp X &kp C &kp V &kp B &kp &trans &kp LA(LCTRL) &kp N &kp M &kp GB_COMMA &kp GB_DOT &mt RCTRL GB_FSLH &kp RSHFT
&lt SMB1 GB_GRAVE &mo MED2 &kp LGUI &kp LALT &kp LCTRL &kp LALT &kp RALT &kp X &mo MED2 &kp LC(A)
&kp SPACE &kp BSPC &kp TAB &kp RET
&kp HOME &kp END &kp PG_UP &kp PG_DN
&mo SMB1 &kp DEL &kp &trans &mo SMB1
>;
};

smb1_layer {
bindings = <
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &trans &trans &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &kp GB_EXCL &kp GB_AT &kp GB_LBRC &kp RBRC &kp GB_PIPE &trans &trans &vim_yank &trans &trans &trans &vim_paste &kp F12
&trans &kp GB_UNDER &kp GB_EQUAL &kp GB_LPAR &kp GB_RPAR &kp GB_DQT &kp LA(LEFT) &kp LA(RIGHT) &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans
&trans &kp GB_PLUS &kp GB_ASTRK &kp GB_LBKT &kp GB_RBKT &kp GB_HASH &kp LA(LC(B)) &kp LA(N5) &trans &trans &trans &trans &kp GB_BSLH &trans
&trans &kp GB_CARET &trans &trans &trans &kp F8 &kp LS(F7) &kp F8 &kp F9 &kp SYSREQ
&trans &trans &kp LC(F8) &kp LA(RET)
&kp LA(LS(F10)) &kp LA(LS(F10)) &kp LS(F10) &kp LS(F9)
&trans &trans &trans &trans
>;
};

med2_layer {
bindings = <
&bootloader &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 &bootloader
&sys_reset &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &sys_reset
&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &trans &kp C_PP
&trans &trans &trans &trans &trans &trans &trans &trans &kp C_PREV &trans &trans &kp C_NEXT &trans &trans
&trans &trans &trans &trans &trans &kp C_VOL_UP &kp C_VOL_DN &kp C_MUTE &trans &trans
&trans &trans &mkp LCLK &mkp RCLK
&trans &trans &trans &trans
&trans &trans &trans &trans
>;
};
};
};
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "dactyl_manuform_5x7.dtsi"

&kscan0 {
col-gpios
= <&gpio0 20 GPIO_ACTIVE_HIGH>
, <&gpio0 22 GPIO_ACTIVE_HIGH>
, <&gpio0 24 GPIO_ACTIVE_HIGH>
, <&gpio1 0 GPIO_ACTIVE_HIGH>
, <&gpio0 11 GPIO_ACTIVE_HIGH>
, <&gpio1 4 GPIO_ACTIVE_HIGH>
, <&gpio1 6 GPIO_ACTIVE_HIGH>
;
};
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "dactyl_manuform_5x7.dtsi"

&default_transform {
col-offset = <7>;
};

&kscan0 {
col-gpios
= <&gpio1 6 GPIO_ACTIVE_HIGH>
, <&gpio1 4 GPIO_ACTIVE_HIGH>
, <&gpio0 11 GPIO_ACTIVE_HIGH>
, <&gpio1 0 GPIO_ACTIVE_HIGH>
, <&gpio0 24 GPIO_ACTIVE_HIGH>
, <&gpio0 22 GPIO_ACTIVE_HIGH>
, <&gpio0 20 GPIO_ACTIVE_HIGH>
;
};
Loading

0 comments on commit 3572edc

Please sign in to comment.