pub enum Button {
Keyboard(Key),
Mouse(MouseButton),
Controller(ControllerButton),
Hat(ControllerHat),
}
Expand description
Models different kinds of buttons.
Variants§
Keyboard(Key)
A keyboard button.
Mouse(MouseButton)
A mouse button.
Controller(ControllerButton)
A controller button.
Hat(ControllerHat)
A controller hat (d-Pad)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Button
impl<'de> Deserialize<'de> for Button
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Button, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Button, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ControllerButton> for Button
impl From<ControllerButton> for Button
source§fn from(btn: ControllerButton) -> Button
fn from(btn: ControllerButton) -> Button
Converts to this type from the input type.
source§impl From<MouseButton> for Button
impl From<MouseButton> for Button
source§fn from(btn: MouseButton) -> Button
fn from(btn: MouseButton) -> Button
Converts to this type from the input type.
source§impl Ord for Button
impl Ord for Button
source§impl PartialEq<Button> for Button
impl PartialEq<Button> for Button
source§impl PartialOrd<Button> for Button
impl PartialOrd<Button> for Button
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Button
impl Serialize for Button
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
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§
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
Mutably borrows from an owned value. Read more