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<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
source§impl From<ControllerButton> for Button
impl From<ControllerButton> for Button
source§fn from(btn: ControllerButton) -> Self
fn from(btn: ControllerButton) -> Self
Converts to this type from the input type.
source§impl From<MouseButton> for Button
impl From<MouseButton> for Button
source§fn from(btn: MouseButton) -> Self
fn from(btn: MouseButton) -> Self
Converts to this type from the input type.