C
CSharp
C++
Java
Visual Basic
HTML - CSS
Android
Asp
Asp.Net
Php
Python
JavaScript
SQL
XML
Assembly
ActiveX
API
Code Snippets
Database
Files Directories Drives
Forms
Graphics Games
Multimedia
Strings
Windows and Controls
More...
Visual Basic > Graphics Games Programming sample source codes
Visual Basic Code > Getting Input from the Joystick
Getting Input from the Joystick Declare Function joyGetPos Lib "winmm.dll" _ (ByVal uJoyID As Long, pji As JOYINFO) As Long Type JOYINFO wXpos As Long wYpos As Long wZpos As Long wButtons As Long End Type Public Function GetJSValues(x As Long, y As Long, _ z As Long, Button1 As Boolean, Button2 As Boolean, _ Button3 As Boolean, Button4 As Boolean) 'Get access to the Type JOYINFO. Dim pos As JOYINFO 'Get the x, y and z values. x = pos.wXpos y = pos.wYpos z = pos.wZpos 'Get the status of the Buttons. Button1 = pos.wButtons And 1 Button2 = pos.wButtons And 2 Button3 = pos.wButtons And 4 Button4 = pos.wButtons And 8 'Follow the pattern above to get other buttons. End Function
Privacy Policy
|
Contact
|
Advertising
|
Link to Us
|
Directory