#[non_exhaustive]pub enum InputKind {
GamepadButton(GamepadButtonType),
SingleAxis(SingleAxis),
DualAxis(DualAxis),
Keyboard(KeyCode),
KeyLocation(ScanCode),
Modifier(Modifier),
Mouse(MouseButton),
MouseWheel(MouseWheelDirection),
MouseMotion(MouseMotionDirection),
}
Expand description
The different kinds of supported input bindings.
Commonly stored in the UserInput
enum.
Unfortunately we cannot use a trait object here, as the types used by Input
require traits that are not object-safe.
Please contact the maintainers if you need support for another type!
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GamepadButton(GamepadButtonType)
A button on a gamepad
SingleAxis(SingleAxis)
A single axis of continuous motion
DualAxis(DualAxis)
Two paired axes of continuous motion
Keyboard(KeyCode)
A logical key on the keyboard.
The actual (physical) key that has to be pressed depends on the keyboard layout.
If you care about the position of the key rather than what it stands for,
use InputKind::KeyLocation
instead.
KeyLocation(ScanCode)
The physical location of a key on the keyboard.
The logical key which is emitted by this key depends on the keyboard layout.
If you care about the output of the key rather than where it is positioned,
use InputKind::Keyboard
instead.
Modifier(Modifier)
A keyboard modifier, like Ctrl
or Alt
, which doesn’t care about which side it’s on.
Mouse(MouseButton)
A button on a mouse
MouseWheel(MouseWheelDirection)
A discretized mousewheel movement
MouseMotion(MouseMotionDirection)
A discretized mouse movement
Trait Implementations§
source§impl<'de> Deserialize<'de> for InputKind
impl<'de> Deserialize<'de> for InputKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<MouseMotionDirection> for InputKind
impl From<MouseMotionDirection> for InputKind
source§fn from(input: MouseMotionDirection) -> Self
fn from(input: MouseMotionDirection) -> Self
source§impl From<MouseWheelDirection> for InputKind
impl From<MouseWheelDirection> for InputKind
source§fn from(input: MouseWheelDirection) -> Self
fn from(input: MouseWheelDirection) -> Self
source§impl From<QwertyScanCode> for InputKind
impl From<QwertyScanCode> for InputKind
source§fn from(input: QwertyScanCode) -> Self
fn from(input: QwertyScanCode) -> Self
source§impl From<SingleAxis> for InputKind
impl From<SingleAxis> for InputKind
source§fn from(input: SingleAxis) -> Self
fn from(input: SingleAxis) -> Self
source§impl PartialEq for InputKind
impl PartialEq for InputKind
impl Copy for InputKind
impl Eq for InputKind
impl StructuralEq for InputKind
impl StructuralPartialEq for InputKind
Auto Trait Implementations§
impl RefUnwindSafe for InputKind
impl Send for InputKind
impl Sync for InputKind
impl Unpin for InputKind
impl UnwindSafe for InputKind
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> CallHasher for T
impl<T> CallHasher for 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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.