Struct gilrs::GamepadState [] [src]

pub struct GamepadState {
    pub right_stick: (f32, f32),
    pub left_stick: (f32, f32),
    pub z: (f32, f32),
    pub btn_left_thumb: bool,
    pub btn_right_thumb: bool,
    pub right_trigger: f32,
    pub right_trigger2: f32,
    pub left_trigger: f32,
    pub left_trigger2: f32,
    pub btn_south: bool,
    pub btn_east: bool,
    pub btn_north: bool,
    pub btn_west: bool,
    pub btn_c: bool,
    pub btn_z: bool,
    pub btn_select: bool,
    pub btn_start: bool,
    pub btn_mode: bool,
    pub btn_dpad_down: bool,
    pub btn_dpad_left: bool,
    pub btn_dpad_up: bool,
    pub btn_dpad_right: bool,
}

Cached state of gamepad's buttons and axes.

Fields

Methods

impl GamepadState
[src]

Creates new GamepadState with all values zeroed.

Sets new value for given button.

Sets new value for given axis.

Examines cached gamepad state to check if given button is pressed. If btn can also be represented by axis returns true if value is not equal to 0.0. Always returns false for Button::Unknown.

Examines cached gamepad state to check axis's value. If axis is represented by button on device it value is 0.0 if button is not pressed or 1.0 if is pressed. Returns NaN for Axis::Unknown.

Trait Implementations

impl Copy for GamepadState
[src]

impl Clone for GamepadState
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for GamepadState
[src]

Formats the value using the given formatter.

impl Default for GamepadState
[src]

Returns the "default value" for a type. Read more

impl PartialEq for GamepadState
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.