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 keycode: &'a mut Input<KeyCode>,
pub keyboard_events: &'a mut Events<KeyboardInput>,
pub mouse_button: &'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
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<GamepadEventRaw>Events used for mocking gamepad-related inputs
keycode: &'a mut Input<KeyCode>A [KeyCode] [Input] 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
sourceimpl<'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
sourceimpl<'a> Debug for MutableInputStreams<'a>
impl<'a> Debug for MutableInputStreams<'a>
sourceimpl<'a> From<&'a MutableInputStreams<'a>> for InputStreams<'a>
impl<'a> From<&'a MutableInputStreams<'a>> for InputStreams<'a>
sourcefn from(mutable_streams: &'a MutableInputStreams<'a>) -> Self
fn from(mutable_streams: &'a MutableInputStreams<'a>) -> Self
sourceimpl<'a> From<MutableInputStreams<'a>> for InputStreams<'a>
impl<'a> From<MutableInputStreams<'a>> for InputStreams<'a>
sourcefn from(mutable_streams: MutableInputStreams<'a>) -> Self
fn from(mutable_streams: MutableInputStreams<'a>) -> Self
sourceimpl MockInput for MutableInputStreams<'_>
impl MockInput for MutableInputStreams<'_>
sourcefn send_input(&mut self, input: impl Into<UserInput>)
fn send_input(&mut self, input: impl Into<UserInput>)
user_input directly Read moresourcefn 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 moresourcefn release_input(&mut self, input: impl Into<UserInput>)
fn release_input(&mut self, input: impl Into<UserInput>)
user_input directly Read moresourcefn 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 moresourcefn pressed(&self, input: impl Into<UserInput>) -> bool
fn pressed(&self, input: impl Into<UserInput>) -> bool
user_input pressed? Read moresourcefn 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 Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn 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, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn 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. Read morefn 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. Read more