Struct dualshock3::Controller [−][src]
The controller abstracts away over controller state at specific points and allows to detect when a button is pressed or released. It also combines the X and Y axis for each stick into a coordinate and turns the triggers into values in [0, 1].
Implementations
impl Controller
[src]
pub fn new(buf: ControllerValues) -> Controller
[src]
pub fn update(&mut self, new_vals: ControllerValues)
[src]
pub fn left_pos(&self) -> Coordinate
[src]
pub fn right_pos(&self) -> Coordinate
[src]
pub fn left_trigger(&self) -> f64
[src]
Returns a value in [0, 1]
pub fn right_trigger(&self) -> f64
[src]
Returns a value in [0, 1]
pub fn was_pressed(&self, btn: Button) -> bool
[src]
pub fn is_pressed(&self, btn: Button) -> bool
[src]
pub fn was_released(&self, btn: Button) -> bool
[src]
pub fn has_any_input(&self) -> bool
[src]
Indicates whether there is currently any kind of user input. A pressed button, or a moved joystick.
Auto Trait Implementations
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnwindSafe for Controller
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,