| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>GetJoy ([port])</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- port = optional joystick port to read
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Unlike the other similar commands (JoyDown and JoyHit), this command doesn't need to know which button you are trying to test for. It looks for any joystick button, then returns the number the user pressed. Since you are polling all the buttons instead of just a specific one, this may be a tad less efficient than using JoyDown or JoyHit. Use this command in conjunction with Select/Case for maximum efficiency!
- </td>
- </tr>
- </table>
- <h1><a href=../2d_examples/GetJoy.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; GetJoy Example
<br />
-
<br />
- While Not KeyHit(1)
<br />
- button=GetJoy()
<br />
- If button <> 0 Then
<br />
- Print "You pressed joystick button #" + button
<br />
- End If
<br />
- Wend
<br />
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=GetJoy&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|