Skip to main content

apply_axis_deadzone

Function apply_axis_deadzone 

Source
pub fn apply_axis_deadzone(value: f64) -> f64
Expand description

Applies the analog deadzone to a single raw axis reading.

A reading at or inside the deadzone band reports 0.0; a reading beyond it is rescaled so the usable range still reaches 1.0 at full deflection. Sign is preserved, so a stick pushed left stays negative.

§Arguments

  • f64 - The raw axis reading as reported by the browser.

§Returns

  • f64 - The deadzone-corrected reading, centered inside the band.