mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-19 20:45:18 -05:00
feat(split): Make locality work nested behavior invocations
Co-authored-by: Tokazio <tokazio@hotmail.com>
This commit is contained in:
committed by
Pete Johanson
parent
11f600d9e5
commit
9e36ebd525
@@ -26,6 +26,7 @@ struct zmk_behavior_binding_event {
|
||||
int layer;
|
||||
uint32_t position;
|
||||
int64_t timestamp;
|
||||
uint8_t source;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,19 @@ struct zmk_behavior_binding_event {
|
||||
*/
|
||||
const struct device *zmk_behavior_get_binding(const char *name);
|
||||
|
||||
/**
|
||||
* @brief Invoke a behavior given its binding and invoking event details.
|
||||
*
|
||||
* @param src_binding Behavior binding to invoke.
|
||||
* @param event The binding event struct containing details of the event that invoked it.
|
||||
* @param pressed Whether the binding is pressed or released.
|
||||
*
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
int zmk_behavior_invoke_binding(const struct zmk_behavior_binding *src_binding,
|
||||
struct zmk_behavior_binding_event event, bool pressed);
|
||||
|
||||
/**
|
||||
* @brief Get a local ID for a behavior from its @p name field.
|
||||
*
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
#include <stdint.h>
|
||||
#include <zmk/behavior.h>
|
||||
|
||||
int zmk_behavior_queue_add(uint32_t position, const struct zmk_behavior_binding behavior,
|
||||
bool press, uint32_t wait);
|
||||
int zmk_behavior_queue_add(uint32_t position, uint8_t source,
|
||||
const struct zmk_behavior_binding behavior, bool press, uint32_t wait);
|
||||
|
||||
@@ -20,6 +20,7 @@ struct sensor_event {
|
||||
|
||||
struct zmk_split_run_behavior_data {
|
||||
uint8_t position;
|
||||
uint8_t source;
|
||||
uint8_t state;
|
||||
uint32_t param1;
|
||||
uint32_t param2;
|
||||
|
||||
Reference in New Issue
Block a user