JoyHit.htm 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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>JoyHit (button,[port])</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. button = number of joystick button to check <br />
  13. port = number of joystick port to check (optional)
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. This command returns the number of times a specified joystick button has been hit since the last time you called the JoyHit() command. Also see KeyHit and MouseHit.
  22. </td>
  23. </tr>
  24. </table>
  25. <h1><a href=../2d_examples/JoyHit.bb>Example</a></h1>
  26. <table>
  27. <tr>
  28. <td>
  29. ; JoyHit Example <br />
  30. <br />
  31. ; Set up the timer <br />
  32. current=MilliSecs() <br />
  33. Print "Press FireButton 1 a bunch of times for five seconds..." <br />
  34. <br />
  35. ; Wait 5 seconds <br />
  36. While MilliSecs() < current+5000 <br />
  37. Wend <br />
  38. <br />
  39. ; Print the results <br />
  40. Print "Pressed button " + JoyHit(1) + " times." <br />
  41. </td>
  42. </tr>
  43. </table>
  44. <br>
  45. <a target=_top href=../index.htm>Index</a><br>
  46. <br>
  47. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=JoyHit&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  48. </html>