19 lines
2.0 KiB
HTML
19 lines
2.0 KiB
HTML
<html><head><title>Command: WaitJoy </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'> WaitJoy ([port]) </span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Halts program execution until a joystick button is pressed and returns its button code.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>port = joystick port to check</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This command makes your program halt until a jpystick button is pressed on the joystick. Used alone, it simply halts and waits for a button press. It can also be used to assign the pressed button's code value to a variable. See example.<br>
|
|
<br>
|
|
In MOST CASES, you are not going to want to use this command because chances are likely you are going to want things on the screen still happening while awaiting the button press. In that situation, you'll use a WHILE ... WEND awaiting a JoyHit value - refreshing your screen each loop.<br>
|
|
<br>
|
|
As with any joystick command, you MUST have a DirectX compatible joystick plugged in and properly configured within Windows for it to work. See your joystick documentation for more information.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; WaitJoy() sample<br>
|
|
<br>
|
|
Print "Press a joystick button to continue."<br>
|
|
<br>
|
|
button=WaitJoy()<br>
|
|
<br>
|
|
Print "The joystick button code of the button you pressed was: " + button<br>
|
|
Print "Now press a button to quit."<br>
|
|
<br>
|
|
WaitJoy()<br>
|
|
<br>
|
|
End<br>
|
|
</td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
|
|
</html>
|