mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-26 16:05:18 -05:00
Feature: input processor behavior invocation (#2714)
refactor(pointing): Allow stopping event propagation
Allow input processors to return a special value if a given input event
should not be further processed/propagated.
feat(pointing): Add behavior input processor
Add the ability to intercept certain input events and trigger behaviors
when they occur.
Co-authored-by: Jorge Villalobos <minusfive@users.noreply.github.com>
Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <zmk/matrix.h>
|
||||
#include <zmk/combos.h>
|
||||
#include <zmk/input_listeners.h>
|
||||
#include <zmk/sensors.h>
|
||||
|
||||
/**
|
||||
@@ -22,4 +24,9 @@
|
||||
/**
|
||||
* Gets the virtual key position to use for the combo with the given index.
|
||||
*/
|
||||
#define ZMK_VIRTUAL_KEY_POSITION_COMBO(index) (ZMK_KEYMAP_LEN + ZMK_KEYMAP_SENSORS_LEN + (index))
|
||||
#define ZMK_VIRTUAL_KEY_POSITION_COMBO(index) \
|
||||
(ZMK_VIRTUAL_KEY_POSITION_SENSOR(ZMK_KEYMAP_SENSORS_LEN) + (index))
|
||||
|
||||
#define ZMK_VIRTUAL_KEY_POSITION_BEHAVIOR_INPUT_PROCESSOR(listener_index, processor_index) \
|
||||
(ZMK_VIRTUAL_KEY_POSITION_COMBO(ZMK_COMBOS_LEN) + \
|
||||
(ZMK_INPUT_LISTENERS_LEN * (processor_index)) + (listener_index))
|
||||
|
||||
Reference in New Issue
Block a user