Struct piston_window::ButtonArgs
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
impl Clone for ButtonArgs
impl Clone for ButtonArgs
fn clone(&self) -> ButtonArgs
fn clone(&self) -> ButtonArgs
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Debug for ButtonArgs
impl Debug for ButtonArgs
impl<'de> Deserialize<'de> for ButtonArgs
impl<'de> Deserialize<'de> for ButtonArgs
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
impl From<ButtonArgs> for Input
impl From<ButtonArgs> for Input
fn from(args: ButtonArgs) -> Input
fn from(args: ButtonArgs) -> Input
Converts to this type from the input type.
impl Hash for ButtonArgs
impl Hash for ButtonArgs
impl PartialEq<ButtonArgs> for ButtonArgs
impl PartialEq<ButtonArgs> for ButtonArgs
fn eq(&self, other: &ButtonArgs) -> bool
fn eq(&self, other: &ButtonArgs) -> bool
impl Serialize for ButtonArgs
impl Serialize for ButtonArgs
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 StructuralEq for ButtonArgs
impl StructuralPartialEq for ButtonArgs
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
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> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.