Enum amethyst_input::Button
source · pub enum Button {
Key(VirtualKeyCode),
ScanCode(u32),
Mouse(MouseButton),
MouseWheel(ScrollDirection),
Controller(u32, ControllerButton),
}
Expand description
A Button is any kind of digital input that the engine supports.
Variants
Key(VirtualKeyCode)
Virtual Keyboard keys, use this when the letter on the key matters more than the position of the key.
ScanCode(u32)
Scan code from keyboard, use this when the position of the key matters more than letter on the key.
Mouse(MouseButton)
Mouse buttons
MouseWheel(ScrollDirection)
Mouse wheel
Controller(u32, ControllerButton)
Controller buttons matching SDL controller model. A tuple of sequential controller_id in order of connection and specific type of used controller button.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Button
impl<'de> Deserialize<'de> for Button
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<MouseButton> for Button
impl From<MouseButton> for Button
sourcefn from(mouse_button: MouseButton) -> Self
fn from(mouse_button: MouseButton) -> Self
Converts to this type from the input type.
sourceimpl From<VirtualKeyCode> for Button
impl From<VirtualKeyCode> for Button
sourcefn from(keycode: VirtualKeyCode) -> Self
fn from(keycode: VirtualKeyCode) -> Self
Converts to this type from the input type.
impl Copy for Button
impl Eq for Button
impl StructuralEq for Button
impl StructuralPartialEq for Button
Auto Trait Implementations
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<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
Mutably borrows from an owned value. Read more
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>
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 morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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 morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&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)
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