Struct input::ButtonArgs [−][src]
pub struct ButtonArgs {
pub state: ButtonState,
pub button: Button,
pub scancode: Option<i32>,
}
Expand description
Button arguments.
Fields
state: ButtonState
New state of the button.
The button that changed state.
scancode: Option<i32>
An optional scancode that tells the physical layout of a keyboard key.
For other devices than keyboard, this is set to None
.
Scancode follows SDL (https://wiki.libsdl.org/SDL_Scancode).
This is stored here to make Button
equality check work with keyboard layouts.
Some window backends might not support scancodes. To test a window backend, use https://github.com/PistonDevelopers/piston-examples/tree/master/user_input
Trait Implementations
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
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ButtonArgs
impl Send for ButtonArgs
impl Sync for ButtonArgs
impl Unpin for ButtonArgs
impl UnwindSafe for ButtonArgs
Blanket Implementations
Mutably borrows from an owned value. Read more