Skip to content

Commit

Permalink
add swapper for alt+tab and gui+tab (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
kucera-lukas authored Mar 11, 2023
1 parent 3ec3ed8 commit b37b0ba
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
10 changes: 6 additions & 4 deletions miryoku/custom_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

#include "hold_tap.h"
#include "macros.h"
#include "swapper.h"

#include "combos.dtsi"
#include "hold_tap.dtsi"
#include "macros.dtsi"
#include "swapper.dtsi"

#define XXX &none

Expand Down Expand Up @@ -43,10 +45,10 @@ U_NP, U_NP, U_LT(U_MEDIA, ESC),U_LT(U_NAV, SPC), U_LT
U_NP, U_NP, &kp ESC, &kp SPACE, &kp TAB, &kp DEL, &kp BSPC, &kp RET, U_NP, U_NP

#define MIRYOKU_LAYER_NAV \
U_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_to_U_BASE, U_NA, &kp PG_UP, &kp HOME, U_NAV_UP, &kp END, &kp INS, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp PG_DN, U_NAV_LEFT, U_NAV_DOWN, U_NAV_RIGHT, U_NP, \
U_NA, &kp RALT, &u_to_U_SYM, &u_to_U_NAV, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
U_NP, U_NP, U_NA, U_NA, U_NA, U_NAV_DEL, U_NAV_BSPC, &kp RET, U_NP, U_NP
U_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_to_U_BASE, U_NA, &kp PG_UP, &kp LS(LC(TAB)), U_NAV_UP, &kp LC(TAB), &kp LS(TAB), \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp PG_DN, U_NAV_LEFT, U_NAV_DOWN, U_NAV_RIGHT, U_ALT_GUI_TAB_SWAPPER, \
U_NA, &kp RALT, &u_to_U_SYM, &u_to_U_NAV, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
U_NP, U_NP, U_NA, U_NA, U_NA, U_NAV_DEL, U_NAV_BSPC, &kp RET, U_NP, U_NP

#define MIRYOKU_LAYER_SYM \
U_SINGLE_DOUBLE_TILDE, U_SINGLE_TRIPLE_BACKTICK, U_SINGLE_DOUBLE_BACKSLASH, U_SINGLE_DOUBLE_AMPERSAND, U_SINGLE_DOUBLE_PLUS, U_NA, &u_to_U_BASE, &u_to_U_EXTRA, &u_to_U_TAP, U_BOOT, \
Expand Down
33 changes: 33 additions & 0 deletions miryoku/swapper.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2022 Lukas Kucera
// https://github.com/kucera-lukas/miryoku

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

/ {
behaviors {
alt_tab_swapper: alt_tab_swapper {
compatible = "zmk,behavior-tri-state";
label = "alt_tab_swapper";
#binding-cells = <0>;
bindings = <&kt LALT>, <&kp TAB>, <&kt LALT>;
ignored-key-positions = <26>;
};

gui_tab_swapper: gui_tab_swapper {
compatible = "zmk,behavior-tri-state";
label = "gui_tab_swapper";
#binding-cells = <0>;
bindings = <&kt LGUI>, <&kp TAB>, <&kt LGUI>;
ignored-key-positions = <26 32>;
};

alt_gui_tab_swapper: alt_gui_tab_swapper {
compatible = "zmk,behavior-mod-morph";
label = "alt_gui_tab_swapper";
#binding-cells = <0>;
bindings = <&alt_tab_swapper>, <&gui_tab_swapper>;
mods = <(MOD_LSFT|MOD_RSFT)>;
};
};
};
6 changes: 6 additions & 0 deletions miryoku/swapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright 2022 Lukas Kucera
// https://github.com/kucera-lukas/miryoku

#pragma once

#define U_ALT_GUI_TAB_SWAPPER &alt_gui_tab_swapper

0 comments on commit b37b0ba

Please sign in to comment.