Struct piston_window::prelude::ButtonArgs
source · 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§
source§impl Clone for ButtonArgs
impl Clone for ButtonArgs
source§fn clone(&self) -> ButtonArgs
fn clone(&self) -> ButtonArgs
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ButtonArgs
impl Debug for ButtonArgs
source§impl<'de> Deserialize<'de> for ButtonArgs
impl<'de> Deserialize<'de> for ButtonArgs
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ButtonArgs, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ButtonArgs, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<ButtonArgs> for Input
impl From<ButtonArgs> for Input
source§fn from(args: ButtonArgs) -> Input
fn from(args: ButtonArgs) -> Input
Converts to this type from the input type.
source§impl Hash for ButtonArgs
impl Hash for ButtonArgs
source§impl Ord for ButtonArgs
impl Ord for ButtonArgs
source§fn cmp(&self, other: &ButtonArgs) -> Ordering
fn cmp(&self, other: &ButtonArgs) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ButtonArgs
impl PartialEq for ButtonArgs
source§fn eq(&self, other: &ButtonArgs) -> bool
fn eq(&self, other: &ButtonArgs) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ButtonArgs
impl PartialOrd for ButtonArgs
source§fn partial_cmp(&self, other: &ButtonArgs) -> Option<Ordering>
fn partial_cmp(&self, other: &ButtonArgs) -> Option<Ordering>
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 ButtonArgs
impl Serialize for ButtonArgs
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 ButtonArgs
impl Eq for ButtonArgs
impl StructuralPartialEq for ButtonArgs
Auto Trait Implementations§
impl Freeze for ButtonArgs
impl RefUnwindSafe for ButtonArgs
impl Send for ButtonArgs
impl Sync for ButtonArgs
impl Unpin for ButtonArgs
impl UnwindSafe for ButtonArgs
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