pub struct Axis1Action {
pub value: f32,
pub pointer_moved: bool,
}Expand description
1-D analog axis: −1.0 … 1.0 (triggers, scroll wheels, an absolute pointer coordinate).
Fields§
§value: f32Current axis value.
pointer_moved: boolTrue on the tick a Binding::PointerPosition on this action reported a
coordinate different from the one it was holding.
The edge an absolute source has and a relative one does not. A scroll
axis returns to zero every ActionMap::begin_tick, so a non-zero value
already means “this moved”; a pointer axis holds its position across
ticks — that is the whole point of it — so its value says where the
pointer is and nothing about whether the player just asked for anything.
Cleared by ActionMap::begin_tick, like ButtonAction::just_pressed.
A consumer that drives one thing from both a pointer and the keyboard
reads this to decide which spoke most recently — see the
Binding::PointerPosition docs.