GetMouse.htm 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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>GetMouse()</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. None.
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Unlike the other similar commands (MouseDown and MouseHit), this command doesn't need to know which button you are trying to test for. It looks for any mouse button, then returns the number the user clicked. Since you are polling all the mouse buttons instead of just a specific one, this may be a tad less efficient than using MouseDown or MouseHit. Use this command in conjunction with Select/Case for maximum efficiency!
  21. </td>
  22. </tr>
  23. </table>
  24. <h1><a href=../2d_examples/GetMouse.bb>Example</a></h1>
  25. <table>
  26. <tr>
  27. <td>
  28. ; GetMouse Example <br />
  29. <br />
  30. While Not KeyHit(1) <br />
  31. button=GetMouse() <br />
  32. If button <> 0 Then <br />
  33. Print "You pressed mouse button #" + button <br />
  34. End If <br />
  35. Wend <br />
  36. </td>
  37. </tr>
  38. </table>
  39. <br>
  40. <a target=_top href=../index.htm>Index</a><br>
  41. <br>
  42. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=GetMouse&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  43. </html>