-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added optional flags to toggling behaviors allowing them to be …
…explicitly toggle on or toggle off.
- Loading branch information
1 parent
a72327b
commit 4ac5b3c
Showing
22 changed files
with
293 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
s/.*hid_listener_keycode_//p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "../behavior_keymap.dtsi" | ||
|
||
&kt { | ||
toggle-mode = "off"; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
>; | ||
}; | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kt B &trans | ||
&trans &kp B | ||
>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
s/.*hid_listener_keycode_//p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: unregistering usage_page 0x07 keycode 0x05 since it was already pressed | ||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: unregistering usage_page 0x07 keycode 0x05 since it was already pressed | ||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "../behavior_keymap.dtsi" | ||
|
||
&kt { | ||
toggle-mode = "on"; | ||
}; | ||
|
||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
>; | ||
}; | ||
|
||
/ { | ||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kt B &trans | ||
&trans &kp B | ||
>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
default_layer { | ||
bindings = < | ||
&kp B &tog 1 | ||
&kp D &kp G>; | ||
&kp D &to 1>; | ||
}; | ||
|
||
lower_layer { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
s/.*hid_listener_keycode/kp/p | ||
s/.*to_keymap_binding/to/p | ||
s/.*layer_changed/layer_changed/p | ||
s/.*tog_keymap_binding/tog/p |
14 changes: 14 additions & 0 deletions
14
app/tests/toggle-layer/toggle-mode-off/keycode_events.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
tog_pressed: position 1 layer 1 | ||
tog_released: position 1 layer 1 | ||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
to_pressed: position 3 layer 1 | ||
layer_changed: layer 1 state 1 | ||
to_released: position 3 layer 1 | ||
kp_pressed: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 | ||
tog_pressed: position 1 layer 1 | ||
layer_changed: layer 1 state 0 | ||
tog_released: position 1 layer 1 | ||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 |
25 changes: 25 additions & 0 deletions
25
app/tests/toggle-layer/toggle-mode-off/native_posix_64.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
#include "../behavior_keymap.dtsi" | ||
|
||
&tog { | ||
toggle-mode = "off"; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
s/.*hid_listener_keycode/kp/p | ||
s/.*tog_keymap_binding/tog/p |
8 changes: 8 additions & 0 deletions
8
app/tests/toggle-layer/toggle-mode-on/keycode_events.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tog_pressed: position 1 layer 1 | ||
tog_released: position 1 layer 1 | ||
kp_pressed: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 | ||
tog_pressed: position 1 layer 1 | ||
tog_released: position 1 layer 1 | ||
kp_pressed: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x0C keycode 0xB5 implicit_mods 0x00 explicit_mods 0x00 |
21 changes: 21 additions & 0 deletions
21
app/tests/toggle-layer/toggle-mode-on/native_posix_64.keymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
#include "../behavior_keymap.dtsi" | ||
|
||
&tog { | ||
toggle-mode = "on"; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.