Skip to main content

Input Processor Overview

Input Processors Overview

"Input processors" are small pieces of functionality that process and optionally modify events generated from emulated and physical pointing devices. Processors can do things like scaling movement values to make them larger or smaller for detailed work, swapping the event types to turn movements into scroll events, or temporarily enabling an extra layer while the pointer is in use.

Usage

For information on using input processors with a given pointing device, see input processor usage.

Available Processors

Below is a summary of pre-defined input processors and user-definable input processors available in ZMK, with references to documentation pages describing them.

Pre-Defined Processors

A set of predefined input processors is available by adding the following at the top of your keymap/overlay file:

#include <input/processors.dtsi>

Once included, you can use the following:

BindingProcessorDescription
&zip_xy_scalerXY ScalerScale a the X/Y input events using a multiplier and divisor
&zip_x_scalerX ScalerScale a the X input events using a multiplier and divisor
&zip_y_scalerY ScalerScale a the Y input events using a multiplier and divisor
&zip_xy_transformXY TransformTransform X/Y values, e.g. inverting or swapping
&zip_scroll_transformScroll TransformTransform wheel/horizontal wheel values, e.g. inverting or swapping
&zip_xy_to_scroll_mapperXY To Scroll MapperMap X/Y values to scroll wheel/horizontal wheel events
&zip_xy_swap_mapperXY Swap MapperSwap X/Y values
&zip_temp_layerTemporary LayerTemporarily enable a layer during pointer use
&zip_button_behaviorsMouse Button BehaviorsTrigger behaviors when certain mouse buttons are pressed

User-Defined Processors

Several of the input processors that have predefined instances, e.g. &zip_xy_scaler or &zip_xy_to_scroll_mapper can also have new instances created with custom properties around which input codes to scale, or which codes to map, etc.

CompatibleProcessorDescription
zmk,input-processor-transformTransformPerform various transforms like inverting values
zmk,input-processor-code-mapperCode MapperMap one event code to another type
zmk,input-processor-behaviorsBehaviorsTrigger behaviors for certain matching input events

External Processors

Much like behaviors, custom input processors can also be added to external modules to allow complete control of the processing operation. See input_processor.h for the definition of the driver API.