|
-
Nov 14th, 2009, 06:04 PM
#1
Thread Starter
Junior Member
use joystickes
Dear friend
I want to use joystickes in my program
to add points by pressing buttons
i need code to program USB port of the computer so i can press boutton from the joysticks. thank you and God Bless you
-
Nov 15th, 2009, 02:59 PM
#2
Fanatic Member
Richard Grier, Consultant, Hard & Software
Microsoft MVP (Visual Basic)
-
Nov 15th, 2009, 03:05 PM
#3
Fanatic Member
Re: use joystickes
Sorry, my other reply was with reference to VB .NET. However, there are a number of suggestions on google. Just enter the keywords VB6 Joystick (DirectX or USB).
Richard Grier, Consultant, Hard & Software
Microsoft MVP (Visual Basic)
-
Nov 26th, 2009, 04:30 PM
#4
Thread Starter
Junior Member
Re: use joystickes
More details so to make everyone understand what I want,
I want to use joystickes in my VB6 program
to add points numbers to label or text in VB6 by pressing buttons of the joystickes,
i need VB6 code to my program joystickes USB port of the computer so i can press boutton from the joysticks
and 1 point number count in the label in my program, and when I press again 1 point number will be added,
so the label will show 2, and when I press again will show 3 and so on,
Thank you Very Much.
-
Nov 26th, 2009, 09:08 PM
#5
Fanatic Member
Re: use joystickes
Try this to get 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
Richard Grier, Consultant, Hard & Software
Microsoft MVP (Visual Basic)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|