forked from kofal.net/zmk
feat(behaviors): Add macro support.
* Fine grainted press/release/tap actions. * TIming between actions can be controlled. * Processed async, to avoid blocking.
This commit is contained in:
committed by
Pete Johanson
parent
58c7c0ee0c
commit
3a6a249ad0
2
app/tests/macros/basic/events.patterns
Normal file
2
app/tests/macros/basic/events.patterns
Normal file
@@ -0,0 +1,2 @@
|
||||
s/.*hid_listener_keycode/kp/p
|
||||
s/.*behavior_queue_process_next/queue_process_next/p
|
||||
18
app/tests/macros/basic/keycode_events.snapshot
Normal file
18
app/tests/macros/basic/keycode_events.snapshot
Normal file
@@ -0,0 +1,18 @@
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70004 0x00
|
||||
kp_pressed: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 50ms
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70004 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x04 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 10ms
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70005 0x00
|
||||
kp_pressed: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 50ms
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70005 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x05 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 10ms
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70006 0x00
|
||||
kp_pressed: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 50ms
|
||||
queue_process_next: Invoking KEY_PRESS: 0x70006 0x00
|
||||
kp_released: usage_page 0x07 keycode 0x06 implicit_mods 0x00 explicit_mods 0x00
|
||||
queue_process_next: Processing next queued behavior in 10ms
|
||||
14
app/tests/macros/basic/native_posix.keymap
Normal file
14
app/tests/macros/basic/native_posix.keymap
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/kscan_mock.h>
|
||||
#include "../behavior_keymap.dtsi"
|
||||
|
||||
&kscan {
|
||||
events = <ZMK_MOCK_PRESS(0,0,10) ZMK_MOCK_RELEASE(0,0,1000)>;
|
||||
};
|
||||
Reference in New Issue
Block a user