wut
v1.7.0
Wii U Toolchain
|
KPAD is a high-level library over WPAD. More...
Data Structures | |
struct | KPADVec2D |
2D vector. More... | |
struct | KPADVec3D |
3D vector. More... | |
struct | KPADStatus |
A structure containing the Wii Remote data. More... | |
union | KPADStatus.__unnamed46__ |
Extension data, check with extensionType to see what is valid to read. More... | |
struct | KPADStatus.__unnamed46__.nunchuk |
Structure to use when extension type is set to WPAD_EXT_NUNCHUK. More... | |
struct | KPADStatus.__unnamed46__.classic |
Structure to use when extension type is set to WPAD_EXT_CLASSIC. More... | |
struct | KPADStatus.__unnamed46__.pro |
Structure to use when extension type is set to WPAD_EXT_PRO_CONTROLLER. More... | |
Typedefs | |
typedef enum WPADChan | KPADChan |
Wii Remote channel. More... | |
typedef enum WPADDataFormat | KPADDataFormat |
Data format. More... | |
typedef enum WPADExtensionType | KPADExtensionType |
Extension type. More... | |
typedef enum WPADMplsMode | KPADMplsMode |
MotionPlus Mode. More... | |
typedef struct KPADStatus | KPADStatus |
typedef struct KPADVec2D | KPADVec2D |
typedef struct KPADVec3D | KPADVec3D |
typedef enum KPADError | KPADError |
Error. More... | |
typedef WPADConnectCallback | KPADConnectCallback |
Enumerations | |
enum | KPADError { KPAD_ERROR_OK = 0 , KPAD_ERROR_NO_SAMPLES = -1 , KPAD_ERROR_INVALID_CONTROLLER = -2 , KPAD_ERROR_WPAD_UNINIT = -3 , KPAD_ERROR_BUSY = -4 , KPAD_ERROR_UNINITIALIZED = -5 } |
Error. More... | |
Functions | |
void | KPADInit () |
Initialises the KPAD library for use. More... | |
void | KPADShutdown () |
Cleans up and frees the KPAD library. More... | |
int32_t | KPADRead (KPADChan chan, KPADStatus *data, uint32_t size) |
Read data from the desired controller. More... | |
int32_t | KPADReadEx (KPADChan chan, KPADStatus *data, uint32_t size, KPADError *error) |
Read data from the desired controller. More... | |
int32_t | KPADSetMaxControllers (uint32_t maxControllers) |
Set the maximum amount of controllers which can be connected to the system. More... | |
uint32_t | KPADGetMaxControllers (void) |
Get the maximum amount of controllers which can be connected to the system. More... | |
uint32_t | KPADGetGameMaxControllers (void) |
Get the maximum amount of controllers which can be connected, as reported by IOS-PAD. More... | |
KPADConnectCallback | KPADSetConnectCallback (KPADChan chan, KPADConnectCallback callback) |
Set a callback for when a controller connection status changes. More... | |
void | KPADEnableMpls (KPADChan channel, KPADMplsMode mode) |
Sets MotionPlus for the controller in specified mode. More... | |
void | KPADDisableMpls (KPADChan channel) |
Disables MotionPlus for the controller. More... | |
KPADMplsMode | KPADGetMplsStatus (KPADChan chan) |
Get MotionPlus mode. More... | |
void | KPADEnableDPD (KPADChan chan) |
Enable IR pointing. More... | |
void | KPADDisableDPD (KPADChan chan) |
Disable IR pointing. More... | |
KPAD is a high-level library over WPAD.
struct KPADVec3D |
struct KPADStatus |
Data Fields | ||
---|---|---|
uint32_t | hold | Indicates what KPADButtons are held down. |
uint32_t | trigger | Indicates what KPADButtons have been pressed since last sample. |
uint32_t | release | Indicates what KPADButtons have been released since last sample. |
KPADVec3D | acc | Indicates the value of the acceleration sensor. |
float | accMagnitude | Indicates the magnitude of acceleration. |
float | accVariation | Indicates the variation in acceleration. |
KPADVec2D | pos | Indicates the position where the Wii Remote is pointing. |
KPADVec2D | angle | Angle. |
uint8_t | extensionType | Value from KPADExtensionType. |
int8_t | error | Value from KPADError. |
int8_t | posValid | Validity of the result. |
uint8_t | format | Value from KPADDataFormat. |
union KPADStatus | __unnamed__ | Extension data, check with extensionType to see what is valid to read. |
union KPADStatus.__unnamed46__ |
Extension data, check with extensionType to see what is valid to read.
Data Fields | ||
---|---|---|
__unnamed46__ | nunchuk | Structure to use when extension type is set to WPAD_EXT_NUNCHUK. |
__unnamed46__ | classic | Structure to use when extension type is set to WPAD_EXT_CLASSIC. |
__unnamed46__ | pro | Structure to use when extension type is set to WPAD_EXT_PRO_CONTROLLER. |
struct KPADStatus.__unnamed46__.nunchuk |
Structure to use when extension type is set to WPAD_EXT_NUNCHUK.
Data Fields | ||
---|---|---|
KPADVec2D | stick | Position of the analog stick. |
KPADVec3D | acc | Indicates the value of the acceleration sensor. |
float | accMagnitude | Indicates the magnitude of acceleration. |
float | accVariation | Indicates the variation in acceleration. |
uint32_t | hold | Indicates what buttons are held down. |
uint32_t | trigger | Indicates what buttons have been pressed since last sample. |
uint32_t | release | Indicates what buttons have been released since last sample. |
struct KPADStatus.__unnamed46__.classic |
Structure to use when extension type is set to WPAD_EXT_CLASSIC.
Data Fields | ||
---|---|---|
uint32_t | hold | Indicates what buttons are held down. |
uint32_t | trigger | Indicates what buttons have been pressed since last sample. |
uint32_t | release | Indicates what buttons have been released since last sample. |
KPADVec2D | leftStick | Position of left analog stick. |
KPADVec2D | rightStick | Position of right analog stick. |
float | leftTrigger | Left trigger. |
float | rightTrigger | Right trigger. |
struct KPADStatus.__unnamed46__.pro |
Structure to use when extension type is set to WPAD_EXT_PRO_CONTROLLER.
Data Fields | ||
---|---|---|
uint32_t | hold | Indicates what buttons are held down. |
uint32_t | trigger | Indicates what buttons have been pressed since last sample. |
uint32_t | release | Indicates what buttons have been released since last sample. |
KPADVec2D | leftStick | Position of left analog stick. |
KPADVec2D | rightStick | Position of right analog stick. |
int32_t | charging | Is charging flag. |
int32_t | wired | Is wired flag. |
typedef enum WPADDataFormat KPADDataFormat |
typedef enum WPADExtensionType KPADExtensionType |
typedef enum WPADMplsMode KPADMplsMode |
typedef struct KPADStatus KPADStatus |
enum KPADError |
Error.
Enumerator | |
---|---|
KPAD_ERROR_OK | No error occurred, and data was written to the buffers. |
KPAD_ERROR_NO_SAMPLES | There was no sample new data available to write. |
KPAD_ERROR_INVALID_CONTROLLER | The requested controller or channel was invalid. |
KPAD_ERROR_WPAD_UNINIT | WPAD is uninitialized, shouldn't happen unless WPADShutdown() is manually called. |
KPAD_ERROR_BUSY | KPAD channel is busy, perhaps being accessed by another thread. |
KPAD_ERROR_UNINITIALIZED | KPAD is uninitialized, need to call KPADInit() |
void KPADInit | ( | ) |
Initialises the KPAD library for use.
void KPADShutdown | ( | ) |
Cleans up and frees the KPAD library.
int32_t KPADRead | ( | KPADChan | chan, |
KPADStatus * | data, | ||
uint32_t | size | ||
) |
Read data from the desired controller.
chan | The channel of the controller to read from. |
data | The KPADStatus to fill. |
size | The maximum number of data to read. |
int32_t KPADReadEx | ( | KPADChan | chan, |
KPADStatus * | data, | ||
uint32_t | size, | ||
KPADError * | error | ||
) |
Read data from the desired controller.
chan | The channel of the controller to read from. |
data | The KPADStatus to fill. |
size | The maximum number of data to read. |
error | A pointer to an error code. |
int32_t KPADSetMaxControllers | ( | uint32_t | maxControllers | ) |
Set the maximum amount of controllers which can be connected to the system.
maxControllers | The maximum amount of controllers. Must be 4 or 7 . |
uint32_t KPADGetMaxControllers | ( | void | ) |
Get the maximum amount of controllers which can be connected to the system.
uint32_t KPADGetGameMaxControllers | ( | void | ) |
Get the maximum amount of controllers which can be connected, as reported by IOS-PAD.
KPADConnectCallback KPADSetConnectCallback | ( | KPADChan | chan, |
KPADConnectCallback | callback | ||
) |
Set a callback for when a controller connection status changes.
chan | The channel of the controller to set a callback for. |
callback | Pointer to a callback function. |
void KPADEnableMpls | ( | KPADChan | channel, |
KPADMplsMode | mode | ||
) |
Sets MotionPlus for the controller in specified mode.
mode | The MotionPlus mode which should be used, the mode may be ignored and a different mode used, usually because the required extension is not connected. Make sure to check result with KPADGetMplsStatus |
void KPADDisableMpls | ( | KPADChan | channel | ) |
Disables MotionPlus for the controller.
KPADMplsMode KPADGetMplsStatus | ( | KPADChan | chan | ) |
Get MotionPlus mode.
identical to WPADiGetMplsStatus
void KPADEnableDPD | ( | KPADChan | chan | ) |
Enable IR pointing.
void KPADDisableDPD | ( | KPADChan | chan | ) |
Disable IR pointing.