#include <revolution/pad.h>
typedef struct PADStatus
{
u16 button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
s8 stickX; // -128 <= stickX <= 127
s8 stickY; // -128 <= stickY <= 127
s8 substickX; // -128 <= substickX <= 127
s8 substickY; // -128 <= substickY <= 127
u8 triggerLeft; // 0 <= triggerLeft <= 255
u8 triggerRight; // 0 <= triggerRight <= 255
u8 analogA; // 0 <= analogA <= 255
u8 analogB; // 0 <= analogB <= 255
s8 err; // one of PAD_ERR_* number
} PADStatus;
#define PAD_MAX_CONTROLLERS 4
#define PAD_BUTTON_LEFT 0x0001
#define PAD_BUTTON_RIGHT 0x0002
#define PAD_BUTTON_DOWN 0x0004
#define PAD_BUTTON_UP 0x0008
#define PAD_TRIGGER_Z 0x0010
#define PAD_TRIGGER_R 0x0020
#define PAD_TRIGGER_L 0x0040
#define PAD_BUTTON_A 0x0100
#define PAD_BUTTON_B 0x0200
#define PAD_BUTTON_X 0x0400
#define PAD_BUTTON_Y 0x0800
#define PAD_BUTTON_START 0x1000
#define PAD_ERR_NONE 0
#define PAD_ERR_NO_CONTROLLER -1
#define PAD_ERR_NOT_READY -2
#define PAD_ERR_TRANSFER -3
The PADStatus data structure represents the status of a controller.
The resolution of the analog inputs can be controlled with the PADSetAnalogMode function.
button |
If any button is depressed, the corresponding bit (PAD_BUTTON_* or PAD_TRIGGER_*) is set to 1. |
||||||||
stickX |
Movement data given in terms of the x-axis of the Control Stick. | ||||||||
stickY |
Movement data given in terms of the y-axis of the Control Stick. | ||||||||
substickX |
Movement data given in terms of the x-axis of the C-Stick (sub analog stick). | ||||||||
substickY |
Movement data given in terms of the y-axis of the C-Stick. | ||||||||
triggerLeft |
Movement data of the L Button. | ||||||||
triggerRight |
Movement data of the R Button. | ||||||||
analogA |
Analog input of the A Button. (see note) | ||||||||
analogB |
Analog input of the B Button. (see note) | ||||||||
err |
Controller error code:
|
Note: The GameCube Controller does not support analog input values (AnalogA/B) for the A and B Buttons. Also, the Revolution controller library WPAD does not support analog input values from the A and B Buttons.
Controller Functions, PADButtonDown, PADButtonUp, PADInit, PADRead, PADReset, PADSetAnalogMode
03/01/2006 Initial version.