-
-
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): Add require-prior-idle-ignore
- Loading branch information
Showing
5 changed files
with
122 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
s/.*hid_listener_keycode_//p |
16 changes: 16 additions & 0 deletions
16
app/tests/combo/require-prior-idle-ignore/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,16 @@ | ||
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 0x1B implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x1B 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 | ||
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 | ||
pressed: usage_page 0x07 keycode 0xE0 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 | ||
released: usage_page 0x07 keycode 0xE0 implicit_mods 0x00 explicit_mods 0x00 | ||
pressed: usage_page 0x07 keycode 0x1B implicit_mods 0x00 explicit_mods 0x00 | ||
released: usage_page 0x07 keycode 0x1B implicit_mods 0x00 explicit_mods 0x00 |
61 changes: 61 additions & 0 deletions
61
app/tests/combo/require-prior-idle-ignore/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,61 @@ | ||
#include <dt-bindings/zmk/keys.h> | ||
#include <behaviors.dtsi> | ||
#include <dt-bindings/zmk/kscan_mock.h> | ||
|
||
/ { | ||
combos { | ||
compatible = "zmk,combos"; | ||
|
||
combo_ab { | ||
timeout-ms = <50>; | ||
key-positions = <0 1>; | ||
bindings = <&kp X>; | ||
require-prior-idle-ms = <100>; | ||
require-prior-idle-ignore = <C LC(D)>; | ||
}; | ||
}; | ||
|
||
keymap { | ||
compatible = "zmk,keymap"; | ||
|
||
default_layer { | ||
bindings = < | ||
&kp A &kp B | ||
&kp C &kp D | ||
&kp LCTL &kp LGUI | ||
>; | ||
}; | ||
}; | ||
}; | ||
|
||
&kscan { | ||
rows = <3>; | ||
columns = <2>; | ||
events = < | ||
// Tap C and then combo, should actuate | ||
ZMK_MOCK_PRESS(1,0,10) | ||
ZMK_MOCK_RELEASE(1,0,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_RELEASE(0,1,100) | ||
|
||
// Tap D and then combo, should NOT actuate | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_RELEASE(0,1,100) | ||
|
||
// Tap LC(D) and then combo, should actuate | ||
ZMK_MOCK_PRESS(2,0,10) | ||
ZMK_MOCK_PRESS(1,1,10) | ||
ZMK_MOCK_RELEASE(1,1,10) | ||
ZMK_MOCK_RELEASE(2,0,10) | ||
ZMK_MOCK_PRESS(0,0,10) | ||
ZMK_MOCK_PRESS(0,1,10) | ||
ZMK_MOCK_RELEASE(0,0,10) | ||
ZMK_MOCK_RELEASE(0,1,100) | ||
>; | ||
}; |