pub enum UserInput {
Single(InputButton),
Chord(PetitSet<InputButton, 8>),
Null,
}
Expand description
Some combination of user input, which may cross [Input
] boundaries
Suitable for use in an [InputMap
]
Variants
Single(InputButton)
A single button
Chord(PetitSet<InputButton, 8>)
A combination of buttons, pressed simultaneously
Up to 8 (!!) buttons can be chorded together at once. Chords are considered to belong to all of the InputModes of their constituent buttons.
Null
A null user input, used for a safe default and error-handling
This input can never be pressed.
Implementations
Creates a UserInput::Chord
from an iterator of [Button
]s
If buttons
has a length of 1, a UserInput::Single
variant will be returned instead.
If buttons
has a length of 0, a UserInput::Null
variant will be returned instead.
Which InputMode
s does this input contain?
Does this UserInput
match the provided InputMode
?
For UserInput::Chord
, this will be true if any of the buttons in the combination match.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for UserInput
impl UnwindSafe for UserInput
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Compare self to key
and return true
if they are equal.
impl<T> FromWorld for T where
T: Default,
impl<T> FromWorld for T where
T: Default,
pub fn from_world(_world: &mut World) -> T
pub fn from_world(_world: &mut World) -> T
Creates Self
using data from the given [World]
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
pub fn vzip(self) -> V
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