#include <revolution/wpad.h> #include <revolution/wpadGuitar.h> #include <revolution/wpadTrain.h> #define WPAD_CHAN0 0 #define WPAD_CHAN1 1 #define WPAD_CHAN2 2 #define WPAD_CHAN3 3 #define WPAD_DEV_CORE 0 #define WPAD_DEV_FREESTYLE 1 #define WPAD_DEV_CLASSIC 2 #define WPAD_DEV_TRAIN 16 #define WPAD_DEV_GUITAR 17 #define WPAD_DEV_FUTURE 251 #define WPAD_DEV_NOT_SUPPORTED 252 #define WPAD_DEV_NOT_FOUND 253 #define WPAD_DEV_UNKNOWN 255 typedef void (* WPADExtensionCallback )( s32 chan, s32 result ); WPADExtensionCallback WPADSetExtensionCallback( s32 chan, WPADExtensionCallback callback );
| chan | One of the WPAD_CHANn values. |
|---|---|
| callback | The callback function that notifies of an event when an External Extension Controller is inserted or removed. |
Pointer to the most recently registered callback function.
Registers a callback function to be notified when an external extension controller is inserted into or removed from a Wii Remote on the specified channel. If NULL is specified, no notifications are made until reset. Note: The Wii Balance Board is not a Wii Remote external extension controller, so this function will not report Wii Balance Board events.
The device type is passed to the callback function's result argument.
When an external extension controller is inserted, this callback is called twice. This is because it takes some time to recognize the device type of the inserted external extension controller. When an external extension controller is inserted, it is not immediately recognized and WPAD_DEV_UNKNOWN is returned with the callback. Once the device type is known, the callback is called again with the device type. If the controller is disconnected during the recognition process, then WPAD_DEV_NOT_FOUND gets passed.
When the external extension controller is removed, this callback is called once and returned with WPAD_DEV_CORE.
Be aware that callback functions registered by using this function will be cleared in the following circumstances.
None.
2008/04/16 Added the Master Controller and Guitar Controller. Added a Note regarding the Wii Balance Board.
2006/10/05 Added mention that the buffer is cleared when a controller is connected.
2006/09/06 Added a description of the case when WPAD_DEV_NOT_FOUND is passed.
2006/08/15 Removed statement that the callback is cleared when an external extension controller is plugged into or unplugged from the console.
2006/06/19 Initial version.
CONFIDENTIAL