pub struct MutableInputStreams<'a> {
    pub gamepad_buttons: &'a mut Input<GamepadButton>,
    pub gamepad_button_axes: &'a mut Axis<GamepadButton>,
    pub gamepad_axes: &'a mut Axis<GamepadAxis>,
    pub gamepads: &'a mut Gamepads,
    pub gamepad_events: &'a mut Events<GamepadEventRaw>,
    pub keycodes: &'a mut Input<KeyCode>,
    pub keyboard_events: &'a mut Events<KeyboardInput>,
    pub mouse_buttons: &'a mut Input<MouseButton>,
    pub mouse_button_events: &'a mut Events<MouseButtonInput>,
    pub mouse_wheel: &'a mut Events<MouseWheel>,
    pub mouse_motion: &'a mut Events<MouseMotion>,
    pub associated_gamepad: Option<Gamepad>,
}
Expand description

A mutable collection of [Input] structs, which can be used for mocking user inputs.

These are typically collected via a system from the World as resources.

Fields§

§gamepad_buttons: &'a mut Input<GamepadButton>

A [GamepadButton] [Input] stream

§gamepad_button_axes: &'a mut Axis<GamepadButton>

A [GamepadButton] [Axis] stream

§gamepad_axes: &'a mut Axis<GamepadAxis>

A [GamepadAxis] [Axis] stream

§gamepads: &'a mut Gamepads

A list of registered [Gamepads]

§gamepad_events: &'a mut Events<GamepadEventRaw>

Events used for mocking gamepad-related inputs

§keycodes: &'a mut Input<KeyCode>

A [KeyCode] [Input] stream

§keyboard_events: &'a mut Events<KeyboardInput>

Events used for mocking keyboard-related inputs

§mouse_buttons: &'a mut Input<MouseButton>

A [MouseButton] [Input] stream

§mouse_button_events: &'a mut Events<MouseButtonInput>

Events used for mocking [MouseButton] inputs

§mouse_wheel: &'a mut Events<MouseWheel>

A [MouseWheel] event stream

§mouse_motion: &'a mut Events<MouseMotion>

A [MouseMotion] event stream

§associated_gamepad: Option<Gamepad>

The [Gamepad] that this struct will detect inputs from

Implementations§

Construct a MutableInputStreams from the [World]

Guess which registered [Gamepad] should be used.

If an associated gamepad is set, use that. Otherwise use the first registered gamepad, if any.

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Send the specified user_input directly Read more
Send the specified user_input directly, using the specified gamepad Read more
Releases the specified user_input directly Read more
Releases the specified user_input directly, using the specified gamepad Read more
Is the provided user_input pressed? Read more
Is the provided user_input pressed for the provided [Gamepad]? Read more
Clears all user input streams, resetting them to their default state Read more
Presses all bevy::ui buttons with the matching Marker component Read more
Hovers over all bevy::ui buttons with the matching Marker component Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Return the T [ShaderType] for self. When used in [AsBindGroup] derives, it is safe to assume that all images in self exist.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more