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
kind: ControllerKind
The classification of this controller.
a: bool
"A" button status.
b: bool
"B" button status.
x: bool
"X" button status.
y: bool
"Y" button status.
up: bool
Directional pad up button status.
down: bool
Directional pad down button status.
left: bool
Directional pad left button status.
right: bool
Directional pad right button status.
l: bool
Digital "L" button (full depression) status.
r: bool
Digital "R" button (full depression) status.
l_analog: u8
The level of depression of the analog "L" button, 0
being completely up, 255
being
completely pressed in.
r_analog: u8
The level of depression of the analog "R" button, 0
being completely up, 255
being
completely pressed in.
z: bool
"Z" button status.
start: bool
Start button status.
stick_x: u8
The x-axis position of the primary analog joystick, 0
being completely left, 255
being
completely right.
stick_y: u8
The y-axis position of the primary analog joystick, 0
being completely down, 255
being
completely up.
c_stick_x: u8
The x-axis position of the secondary ("C") analog joystick, 0
being completely left,
255
being completely right.
c_stick_y: u8
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]
fn clone(&self) -> Controller
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more