Struct dualshock3::Controller[][src]

pub struct Controller { /* fields omitted */ }

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.