evdev.normalize

evdev

normalize(ai, raw, deadzone) -> v

Map a raw axis reading to [-1, 1]

ai is the axis's calibration from dev.axes. The deadzone is the larger of the hardware flat and deadzone, a fraction of the half-range. A reading inside it returns 0. Outside it, the rest of the range is scaled so the value rises from 0 at the deadzone's edge.