leafwing_input_manager

Module input_processing

source
Expand description

Processors for input values

This module simplifies input handling in your application by providing processors for refining and manipulating values before reaching the application logic.

The foundation of this module lies in these enums.

Need something specific? You can also create your own processors by implementing these traits for specific needs.

Feel free to suggest additions to the built-in processors if you have a common use case!

§Built-in Processors

§Digital Conversion

Digital processors convert raw input values into discrete values, similar to f32::signum but returning 0.0 for zero values.

§Inversion

Inversion flips the sign of input values, resulting in a directional reversal of control. For example, positive values become negative, and up becomes down.

§Sensitivity

Sensitivity scales input values with a specified multiplier (doubling, halving, etc.), allowing fine-tuning the responsiveness of controls.

§Value Bounds

Value bounds define an acceptable range for input values, clamping out-of-bounds inputs to the nearest valid value and leaving others as is to avoid unexpected behavior caused by extreme inputs.

§Dead Zones

§Unscaled Versions

Unscaled dead zones specify regions where input values within the regions are considered excluded from further processing and treated as zeros, helping filter out minor fluctuations and unintended movements.

§Scaled Versions

Scaled dead zones transform input values by restricting values within the default bounds, and then scaling non-excluded values linearly into the “live zone”, the remaining region within the bounds after dead zone exclusion.

Re-exports§

Modules§