pub struct Controller { /* private fields */ }
Expand description
A standard controller, similar to one used for a XBox 360
Implementations§
Source§impl Controller
impl Controller
pub fn new(init: ControllerInit) -> Self
Sourcepub fn left_shoulder(&self) -> bool
pub fn left_shoulder(&self) -> bool
Is the left shoulder button down
Sourcepub fn right_shoulder(&self) -> bool
pub fn right_shoulder(&self) -> bool
Is the right shoulder button down
Sourcepub fn left_stick(&self) -> bool
pub fn left_stick(&self) -> bool
Is the left stick button down
Sourcepub fn right_stick(&self) -> bool
pub fn right_stick(&self) -> bool
Is the right stick button down
Sourcepub fn left_stick_x(&self) -> f32
pub fn left_stick_x(&self) -> f32
Left stick position x [-1 - +1] -1 left +1 right
Sourcepub fn left_stick_y(&self) -> f32
pub fn left_stick_y(&self) -> f32
Left stick position y [-1 - +1] -1 up +1 down
Sourcepub fn right_stick_x(&self) -> f32
pub fn right_stick_x(&self) -> f32
Right stick position x [-1 - +1] -1 left +1 right
Sourcepub fn right_stick_y(&self) -> f32
pub fn right_stick_y(&self) -> f32
Right stick position y [-1 - +1] -1 up +1 down
Sourcepub fn left_trigger(&self) -> f32
pub fn left_trigger(&self) -> f32
Left trigger position [0 - +1] +1 fully down
Sourcepub fn right_trigger(&self) -> f32
pub fn right_trigger(&self) -> f32
Right trigger position [0 - +1] +1 fully down
Sourcepub fn set_select(&mut self, value: bool)
pub fn set_select(&mut self, value: bool)
Sets the state of the select button
Sourcepub fn set_left_shoulder(&mut self, value: bool)
pub fn set_left_shoulder(&mut self, value: bool)
Sets the state of the left shoulder button
Sourcepub fn set_right_shoulder(&mut self, value: bool)
pub fn set_right_shoulder(&mut self, value: bool)
Sets the state of the right shoulder button
Sourcepub fn set_left_stick(&mut self, value: bool)
pub fn set_left_stick(&mut self, value: bool)
Sets the state of the left stick button
Sourcepub fn set_right_stick(&mut self, value: bool)
pub fn set_right_stick(&mut self, value: bool)
Sets the state of the right stick button
Sourcepub fn set_left_stick_x(&mut self, value: f32)
pub fn set_left_stick_x(&mut self, value: f32)
Sets the state of the left stick x axis
Sourcepub fn set_left_stick_y(&mut self, value: f32)
pub fn set_left_stick_y(&mut self, value: f32)
Sets the state of the left stick y axis
Sourcepub fn set_right_stick_x(&mut self, value: f32)
pub fn set_right_stick_x(&mut self, value: f32)
Sets the state of the right stick x axis
Sourcepub fn set_right_stick_y(&mut self, value: f32)
pub fn set_right_stick_y(&mut self, value: f32)
Sets the state of the right stick y axis
Sourcepub fn set_left_trigger(&mut self, value: f32)
pub fn set_left_trigger(&mut self, value: f32)
Sets the state of the left trigger
Sourcepub fn set_right_trigger(&mut self, value: f32)
pub fn set_right_trigger(&mut self, value: f32)
Sets the state of the right trigger
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more