pub struct MutableInputStreams<'a> {
pub gamepad_buttons: &'a mut ButtonInput<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<GamepadEvent>,
pub keycodes: &'a mut ButtonInput<KeyCode>,
pub keyboard_events: &'a mut Events<KeyboardInput>,
pub mouse_buttons: &'a mut ButtonInput<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 [ButtonInput] structs, which can be used for mocking user inputs.
These are typically collected via a system from the [World] as resources.
Fields§
A [GamepadButton] Input stream
A [GamepadButton] [Axis] stream
gamepad_axes: &'a mut Axis<GamepadAxis>A [GamepadAxis] [Axis] stream
gamepads: &'a mut GamepadsA list of registered [Gamepads]
gamepad_events: &'a mut Events<GamepadEvent>Events used for mocking gamepad-related inputs
keycodes: &'a mut ButtonInput<KeyCode>A [KeyCode] [ButtonInput] stream
keyboard_events: &'a mut Events<KeyboardInput>Events used for mocking keyboard-related inputs
A [MouseButton] Input stream
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§
source§impl<'a> MutableInputStreams<'a>
impl<'a> MutableInputStreams<'a>
sourcepub fn from_world(world: &'a mut World, gamepad: Option<Gamepad>) -> Self
pub fn from_world(world: &'a mut World, gamepad: Option<Gamepad>) -> Self
Construct a MutableInputStreams from the [World]
sourcepub fn guess_gamepad(&self) -> Option<Gamepad>
pub fn guess_gamepad(&self) -> Option<Gamepad>
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§
source§impl<'a> Debug for MutableInputStreams<'a>
impl<'a> Debug for MutableInputStreams<'a>
source§impl<'a> From<&'a MutableInputStreams<'a>> for InputStreams<'a>
impl<'a> From<&'a MutableInputStreams<'a>> for InputStreams<'a>
source§fn from(mutable_streams: &'a MutableInputStreams<'a>) -> Self
fn from(mutable_streams: &'a MutableInputStreams<'a>) -> Self
source§impl<'a> From<MutableInputStreams<'a>> for InputStreams<'a>
impl<'a> From<MutableInputStreams<'a>> for InputStreams<'a>
source§fn from(mutable_streams: MutableInputStreams<'a>) -> Self
fn from(mutable_streams: MutableInputStreams<'a>) -> Self
source§impl MockInput for MutableInputStreams<'_>
impl MockInput for MutableInputStreams<'_>
source§fn send_input(&mut self, input: impl Into<UserInput>)
fn send_input(&mut self, input: impl Into<UserInput>)
user_input directly Read moresource§fn send_input_as_gamepad(
&mut self,
input: impl Into<UserInput>,
gamepad: Option<Gamepad>
)
fn send_input_as_gamepad( &mut self, input: impl Into<UserInput>, gamepad: Option<Gamepad> )
user_input directly, using the specified gamepad Read moresource§fn release_input(&mut self, input: impl Into<UserInput>)
fn release_input(&mut self, input: impl Into<UserInput>)
user_input directly Read moresource§fn release_input_as_gamepad(
&mut self,
input: impl Into<UserInput>,
gamepad: Option<Gamepad>
)
fn release_input_as_gamepad( &mut self, input: impl Into<UserInput>, gamepad: Option<Gamepad> )
user_input directly, using the specified gamepad Read moresource§fn reset_inputs(&mut self)
fn reset_inputs(&mut self)
Auto Trait Implementations§
impl<'a> RefUnwindSafe for MutableInputStreams<'a>
impl<'a> Send for MutableInputStreams<'a>
impl<'a> Sync for MutableInputStreams<'a>
impl<'a> Unpin for MutableInputStreams<'a>
impl<'a> !UnwindSafe for MutableInputStreams<'a>
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.