1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 7<title>KPADSetBtnRepeat (KPADOld)</title> 8</head> 9 10<body> 11 12<h1>KPADSetBtnRepeat</h1> 13 14<h2>Syntax</h2> 15<dl><dd><pre class="construction"> 16#include <revolution/kpadOld.h> 17 18void KPADSetBtnRepeat( s32 chan, f32 delay_sec, f32 pulse_sec ); 19</pre></dd></dl> 20 21<h2>Arguments</h2> 22<p> 23<TABLE class="arguments" border="1" > 24 <TBODY> 25 <TR> 26<TH>chan</TH> 27<TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 28 </TR> 29 <TR> 30<TH>delay_sec</TH> 31<TD>Specifies the time for holding down the button before the <CODE>KPAD_BUTTON_RPT</CODE> flag gets set. The units are seconds.</TD> 32 </TR> 33 <TR> 34<TH>pulse_sec</TH> 35<TD>If the <CODE>KPAD_BUTTON_RPT</CODE> flag is enabled <SPAN class="argument">delay_sec</SPAN> seconds after a button is pressed and held down, <SPAN class="argument">pulse_sec</SPAN> will specify the time interval (in seconds) at which the <CODE>KPAD_BUTTON_RPT</CODE> flag should be enabled thereafter. The units are seconds. If you do not want this flag enabled at all, set <SPAN class="argument">pulse_sec</SPAN> to 0.</TD> 36 </TR> 37 </TBODY> 38</TABLE> 39</p> 40 41<h2>Return Values</h2> 42<p>None.</p> 43 44<H2>Description</H2> 45<p> 46Sets the repeat feature of the digital button (described in the <a href="./KPADStatus.html"><CODE>KPADStatus</CODE></a> structure). When a button is pressed and held, the <CODE>KPAD_BUTTON_RPT</CODE> flag can be periodically enabled in the <SPAN class="argument">hold</SPAN> member variable of <a href="./KPADStatus.html"><CODE>KPADStatus</CODE></a>. <SPAN class="argument">delay_sec</SPAN> seconds after a button is pressed, the <CODE>KPAD_BUTTON_RPT</CODE> flag gets set every <SPAN class="argument">pulse_sec</SPAN> seconds. In the example shown below, a program is created (using the flags) to perform an action periodically when a button is pressed and held down. 47</p> 48<p> 49<code>if ( (hold & (KPAD_BUTTON_RPT | KPAD_BUTTON_A) ) == (KPAD_BUTTON_RPT | KPAD_BUTTON_A) ) {Your routine}</code> 50</p> 51<p> 52Note 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. 53</p> 54 55<h2>See Also</h2> 56<p>None.</p> 57 58<H2>Revision History</H2> 59<P> 602006/10/25 Changed the name to KPADOld library, beginning with Revolution SDK 2.3.<br>2006/03/01 Initial version.<br> 61</P> 62 63<hr><p>CONFIDENTIAL</p></body> 64</html>