#include <revolution/kpad.h>
void KPADSetBtnRepeat( s32 chan, f32 delay_sec, f32 pulse_sec ) ;
chan |
One of WPAD_CHANn values. |
delay_sec |
Specifies how long the button must remain pressed in order to enable the KPAD_BUTTON_RPT flag. The units are seconds. |
pulse_sec |
When the KPAD_BUTTON_RPT flag is enabled delay_sec seconds after a button is pressed and held down, pulse_sec specifies at what time interval thereafter the KPAD_BUTTON_RPT flag should be enabled. The units are seconds. If you do not want the flag raised at all, set pulse_sec to 0. |
None.
Sets the repeat feature of the digital button (described in the KPADStatus structure). When a button is pressed and held, the KPAD_BUTTON_RPT flag can be periodically enabled in the hold member variable of the KPADStatus structure. After delay_sec seconds pass once a button is pressed, the KPAD_BUTTON_RPT flag is enabled every pulse_sec seconds. For example, a program can be created to perform an action periodically when a button is pressed and held down by using the flags, as shown below:
if ( (hold & (KPAD_BUTTON_RPT | KPAD_BUTTON_A) ) == (KPAD_BUTTON_RPT | KPAD_BUTTON_A) ) {Your routine}
Note that repeat settings are not maintained for each button. In this example, if another button is pressed while the A Button is held, the repeat status will be completely reset.
A repeat feature is similarly available for the Nunchuk and Classic Controller buttons. The Nunchuk button is included in the KPADStatus structure 'hold' member variable just like the Wii Remote, and the repeat management will be common with the Wii Remote.
The Classic Controller button is included in the KPADEXStatus structure 'hold' member variable, and is able to set the KPAD_BUTTON_RPT flag. The repeat management of the Wii Remote buttons and the Classic Controller buttons are independent of each other.
2006/10/25 Revised description to match KPAD version 2.
2006/03/01 Initial version.