Skip to content

FiniteDpad

The FiniteDpad struct stores data about a controller’s dpad.

typedef struct {
uint16_t xAxis;
int xValue;
uint16_t yAxis;
int yValue;
} FiniteDpad;
TypeDescription
uint16_t xAxisThe linux evdev code of the joystick’s.
double xValueThe “range” of the input value from -1 to +1. Negatives are Left & Up while positives are Right and Down.
uint16_t yAxisThe linux evdev code of the joystick’s Y Axis.
double yValueThe “range” of the input value from -1 to +1. Negatives are Left & Up while positives are Right and Down.

Developers in general are discourageed from trying to read data from a gamepad directly as they are a “voliatile type” Controllers can be disconnected at any time for any reason and as such this struct may not always exist when trying to read it even after verifying its existance (TOCTOU).