pub trait FetchUserInput {
// Required methods
fn read_pressed(&mut self, input: impl Buttonlike) -> bool;
fn read_axis_value(&mut self, input: impl Axislike) -> f32;
fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2;
}
Expand description
A trait used to quickly fetch the value of a given UserInput
.
This can be useful for testing purposes.
Required Methods§
sourcefn read_pressed(&mut self, input: impl Buttonlike) -> bool
fn read_pressed(&mut self, input: impl Buttonlike) -> bool
Returns true
if the given Buttonlike
input is currently pressed.
sourcefn read_axis_value(&mut self, input: impl Axislike) -> f32
fn read_axis_value(&mut self, input: impl Axislike) -> f32
Returns the value of the given Axislike
input.
sourcefn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2
fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2
Returns the value of the given DualAxislike
input.
Object Safety§
This trait is not object safe.