Struct vcs_classic_hid::input::State[][src]

pub struct State {
    pub stick_position: StickPosition,
    pub button_1: bool,
    pub button_2: bool,
    pub button_back: bool,
    pub button_menu: bool,
    pub button_fuji: bool,
    pub roll: u16,

A friendly representation of a game controller input state.


stick_position: StickPosition

The position of the stick

button_1: bool

Whether the main button is down

button_2: bool

Whether the secondary trigger is down

button_back: bool

Whether the back button is down

button_menu: bool

Whether the menu/context button is down

button_fuji: bool

Whether the Fuji (Atari) button is down

roll: u16

The absolute position of the rotational paddle, as a number between 0 and 1023


impl State[src]

pub fn from_report(data: &[u8]) -> Self[src]

Obtain the controller’s state from the full report packet.

May panic if the data cannot represent an input report.

Trait Implementations

impl Clone for State[src]

impl Copy for State[src]

impl Debug for State[src]

impl Default for State[src]

impl PartialEq<State> for State[src]

impl StructuralPartialEq for State[src]

Auto Trait Implementations

impl RefUnwindSafe for State

impl Send for State

impl Sync for State

impl Unpin for State

impl UnwindSafe for State

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.