WaitJoy.htm 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>WaitJoy ([port])</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. port = joystick port to check
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. 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 />
  21. <br />
  22. 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 />
  23. <br />
  24. 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.
  25. </td>
  26. </tr>
  27. </table>
  28. <h1><a href=../2d_examples/WaitJoy.bb>Example</a></h1>
  29. <table>
  30. <tr>
  31. <td>
  32. ; WaitJoy() sample <br />
  33. <br />
  34. Print "Press a joystick button to continue." <br />
  35. <br />
  36. button=WaitJoy() <br />
  37. <br />
  38. Print "The joystick button code of the button you pressed was: " + button <br />
  39. Print "Now press a button to quit." <br />
  40. <br />
  41. WaitJoy() <br />
  42. <br />
  43. End <br />
  44. </td>
  45. </tr>
  46. </table>
  47. <br>
  48. <a target=_top href=../index.htm>Index</a><br>
  49. <br>
  50. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=WaitJoy&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  51. </html>