Skip to content

Commit

Permalink
add snipe layer
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaaSaadAbdo authored Jul 27, 2024
1 parent 1a2dde3 commit 6479909
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 44 deletions.
51 changes: 42 additions & 9 deletions config/base30.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define SYMW 7
#ifdef BATREEQ
#define SCROLL 8
#define SNIPE 9
#endif

#define SK(KEY) &nk KEY KEY
Expand Down Expand Up @@ -46,13 +47,6 @@

/ {

combos {
#include "combos30.dtsi"
};
macros {
#include "macros.dtsi"
};

behaviors {

// Sticky key on tap, normal key on hold
Expand Down Expand Up @@ -100,6 +94,14 @@
};

};

combos {
#include "combos30.dtsi"
};
macros {
#include "macros.dtsi"
};


keymap {
compatible = "zmk,keymap";
Expand All @@ -123,7 +125,7 @@
#ifdef BATREEQ
SL(SCROLL)
&mkp MCLK &mkp LCLK &mkp RCLK
&mkp MCLK &mkp LCLK &mo SCROLL &mkp RCLK &mo SYM &kp C_VOL_UP &kp C_VOL_DN &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE
&mkp MCLK &mkp LCLK &mo SCROLL &mkp RCLK &mo SNIPE &kp C_VOL_UP &kp C_VOL_DN &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE
#endif

>;
Expand Down Expand Up @@ -240,7 +242,7 @@
#ifdef BATREEQ
SL(SCROLL)
&mkp MCLK &mkp LCLK &mkp RCLK
&mkp MCLK &mkp LCLK &mo SCROLL &mkp RCLK &mo SYMW &kp C_VOL_UP &kp C_VOL_DN &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE
&mkp MCLK &mkp LCLK &mo SCROLL &mkp RCLK &mo SNIPE &kp C_VOL_UP &kp C_VOL_DN &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE
#endif

>;
Expand Down Expand Up @@ -340,6 +342,7 @@
#endif
};

#ifdef BATREEQ
scroll {
label = "SCROLL";
bindings = <
Expand Down Expand Up @@ -368,6 +371,36 @@
sensor-bindings = <&inc_dec_kp C_VOL_DN C_VOL_UP &inc_dec_kp PG_UP PG_DN>;
#endif
};

snipe {
label = "SNIPE";
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
// ╰─────────────┴─────────────╯ ╰─────────────┴─────────────╯

#ifdef WASFOORA
// up left down right middle
&kp C_VOL_UP &kp C_VOL_DN &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE
#endif

#ifdef BATREEQ
&trans
&trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
#endif

>;

#ifdef ENCODERS
sensor-bindings = <&inc_dec_kp C_VOL_DN C_VOL_UP &inc_dec_kp PG_UP PG_DN>;
#endif
};
#endif
};

};
35 changes: 1 addition & 34 deletions config/boards/shields/batreeq/batreeq.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@
};
};


/*
// map to pins in vik connector

spi1_vik_pmw3610_default: spi1_vik_pmw3610_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 17)>;
};
};

spi1_vik_pmw3610_sleep: spi1_vik_pmw3610_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>,
<NRF_PSEL(SPIM_MISO, 0, 17)>;
low-power-enable;
};
};
*/

spi0_default: spi0_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 20)>,
Expand Down Expand Up @@ -75,17 +53,6 @@ nice_view_spi: &spi1 {
cs-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
};

/*
// map CS correctly
vik_spi_pmw3610: &spi1 {
compatible = "nordic,nrf-spim";
pinctrl-0 = <&spi1_vik_pmw3610_default>;
pinctrl-1 = <&spi1_vik_pmw3610_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
};
*/

&spi0 {
status = "okay";
compatible = "nordic,nrf-spim";
Expand All @@ -102,7 +69,7 @@ vik_spi_pmw3610: &spi1 {
irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

/* optional features */
snipe-layers = <3 7>;
snipe-layers = <3 7 9>;
scroll-layers = <8>;
// automouse-layer = <4>;
};
Expand Down
12 changes: 11 additions & 1 deletion config/combos30.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,14 @@ GCOMBO(switch_to_APT_win, &to APTW, 8 18 29)

/* bluetooth profile + default layer */
COMBO(btblhdn, &macro_btblwin, 27 20 21, ALPHA_ALL)
COMBO(btblhdnw, &macro_btblmac, 27 21 22, ALPHA_ALL)
COMBO(btblhdnw, &macro_btblmac, 27 21 22, ALPHA_ALL)


/* Batreeq trackball combos */
#ifdef BATREEQ
COMBO(LCLICK, LCLK, 26 13, ALPHA_ALL)
COMBO(RCLICK, RCLK, 26 12, ALPHA_ALL)
COMBO(MCLICK, MCLK, 26 11, ALPHA_ALL)
COMBO(SCROLL, SL(SCROLL), 26 21, ALPHA_ALL)
COMBO(SNIPE , &mo SNIPE, 26 20, ALPHA_ALL)
#endif

0 comments on commit 6479909

Please sign in to comment.