Struct gcnctrlusb::Controller [] [src]

pub struct Controller {
    pub kind: ControllerKind,
    pub a: bool,
    pub b: bool,
    pub x: bool,
    pub y: bool,
    pub up: bool,
    pub down: bool,
    pub left: bool,
    pub right: bool,
    pub l: bool,
    pub r: bool,
    pub l_analog: u8,
    pub r_analog: u8,
    pub z: bool,
    pub start: bool,
    pub stick_x: u8,
    pub stick_y: u8,
    pub c_stick_x: u8,
    pub c_stick_y: u8,
}

The state of a GameCube controller at a given moment in time.

Note that the hardware will likely never report either extreme of the spectrum for any of the analog inputs. For example, all u8 fields may report only within the range of 30 to 225. Also, the hardware will likely never report a perfect 127 for the resting position of any of the joystick axes. Keep in my that this library does not do any analog dead zone correction.

Fields

The classification of this controller.

"A" button status.

"B" button status.

"X" button status.

"Y" button status.

Directional pad up button status.

Directional pad down button status.

Directional pad left button status.

Directional pad right button status.

Digital "L" button (full depression) status.

Digital "R" button (full depression) status.

The level of depression of the analog "L" button, 0 being completely up, 255 being completely pressed in.

The level of depression of the analog "R" button, 0 being completely up, 255 being completely pressed in.

"Z" button status.

Start button status.

The x-axis position of the primary analog joystick, 0 being completely left, 255 being completely right.

The y-axis position of the primary analog joystick, 0 being completely down, 255 being completely up.

The x-axis position of the secondary ("C") analog joystick, 0 being completely left, 255 being completely right.

The y-axis position of the secondary ("C") analog joystick, 0 being completely down, 255 being completely up.

Trait Implementations

impl Clone for Controller
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Controller
[src]

impl Debug for Controller
[src]

Formats the value using the given formatter.