Enum gilrs::ev::Axis [−][src]
#[repr(u16)]pub enum Axis { LeftStickX, LeftStickY, LeftZ, RightStickX, RightStickY, RightZ, DPadX, DPadY, Unknown, }
Gamepad's elements which state can be represented by value from -1.0 to 1.0.
Variants
LeftStickX
LeftStickY
LeftZ
RightStickX
RightStickY
RightZ
DPadX
DPadY
Unknown
Methods
impl Axis
[src]
impl Axis
pub fn is_stick(self) -> bool
[src]
pub fn is_stick(self) -> bool
Returns true if axis is LeftStickX
, LeftStickY
, RightStickX
or RightStickY
.
pub fn second_axis(self) -> Option<Self>
[src]
pub fn second_axis(self) -> Option<Self>
Returns the other axis from same element of gamepad, if any.
input | output |
---|---|
LeftStickX | Some(LeftStickY ) |
LeftStickY | Some(LeftStickX ) |
RightStickX | Some(RightStickY ) |
RightStickY | Some(RightStickX ) |
… | None |
Trait Implementations
impl Debug for Axis
[src]
impl Debug for Axis
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Axis
[src]
impl Clone for Axis
fn clone(&self) -> Axis
[src]
fn clone(&self) -> Axis
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Axis
[src]
impl Copy for Axis
impl Eq for Axis
[src]
impl Eq for Axis
impl PartialEq for Axis
[src]
impl PartialEq for Axis
fn eq(&self, other: &Axis) -> bool
[src]
fn eq(&self, other: &Axis) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl Hash for Axis
[src]
impl Hash for Axis