-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(combos): do not interrupt combos on other key release
- Loading branch information
Showing
8 changed files
with
186 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
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 @@ | ||
pressed: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: usage_page 0x07 keycode 0x07 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x07 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,41 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
/ { | ||
combos { | ||
compatible = "zmk,combos"; | ||
|
||
combo_d { | ||
timeout-ms = <50>; | ||
key-positions = <0 1>; | ||
bindings = <&kp D>; | ||
}; | ||
|
||
// not actuated combo to test behavior | ||
combo_g { | ||
timeout-ms = <50>; | ||
key-positions = <2 3>; | ||
bindings = <&kp G>; | ||
}; | ||
}; | ||
|
||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = <&kp A &kp B &kp C &kp D>; | ||
}; | ||
}; | ||
}; | ||
|
||
&kscan { | ||
events = < | ||
ZMK_MOCK_PRESS(0,2,10) // C | ||
ZMK_MOCK_PRESS(0,0,10) // A | ||
ZMK_MOCK_RELEASE(0,2,10) // C | ||
ZMK_MOCK_PRESS(0,1,10) // B | ||
ZMK_MOCK_RELEASE(0,0,0) // A | ||
ZMK_MOCK_RELEASE(0,1,0) // 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,4 @@ | ||
pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00 |
67 changes: 67 additions & 0 deletions
67
app/tests/combo/overlapping-combos-5/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,67 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
/* | ||
combo on 01 and 34 | ||
overlapping combo on 012 and 345 | ||
|
||
press 01 and then 34 both in their combo terms | ||
should actuate both combos | ||
*/ | ||
|
||
/ { | ||
combos { | ||
compatible = "zmk,combos"; | ||
|
||
combo_a { | ||
timeout-ms = <50>; | ||
key-positions = <0 1>; | ||
bindings = <&kp A>; | ||
}; | ||
|
||
combo_b { | ||
timeout-ms = <50>; | ||
key-positions = <3 4>; | ||
bindings = <&kp B>; | ||
}; | ||
|
||
combo_c { | ||
timeout-ms = <100>; | ||
key-positions = <0 1 2>; | ||
bindings = <&kp C>; | ||
}; | ||
|
||
combo_d { | ||
timeout-ms = <100>; | ||
key-positions = <3 4 5>; | ||
bindings = <&kp D>; | ||
}; | ||
}; | ||
|
||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp N0 &kp N1 &kp N2 | ||
&kp N3 &kp N4 &kp N5 | ||
>; | ||
}; | ||
}; | ||
}; | ||
|
||
&kscan { | ||
rows = <2>; | ||
columns = <3>; | ||
events = < | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_PRESS(1,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_RELEASE(0,1,10) | ||
ZMK_MOCK_RELEASE(1,0,10) | ||
ZMK_MOCK_RELEASE(1,1,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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
td_binding_pressed: 2 created new tap dance | ||
td_binding_pressed: 2 tap dance pressed | ||
td_binding_released: 2 tap dance keybind released | ||
kp_pressed: usage_page 0x07 keycode 0x1E implicit_mods 0x00 explicit_mods 0x00 | ||
kp_released: usage_page 0x07 keycode 0x1E implicit_mods 0x00 explicit_mods 0x00 | ||
td_binding_pressed: 1 created new tap dance | ||
td_binding_pressed: 1 tap dance pressed | ||
kp_pressed: usage_page 0x07 keycode 0x16 implicit_mods 0x00 explicit_mods 0x00 | ||
td_binding_released: 2 tap dance keybind released | ||
kp_released: usage_page 0x07 keycode 0x1E implicit_mods 0x00 explicit_mods 0x00 | ||
td_binding_released: 1 tap dance keybind released | ||
kp_released: usage_page 0x07 keycode 0x16 implicit_mods 0x00 explicit_mods 0x00 |