473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

joystick in vb.net code without directX

hi, i have facing some problems in my joystick code. it cant run correctly
and will not return to its center point. hope someone can help me. below is
the code:

Private Sub tmrContinuousDataCollect_Tick(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles tmrContinuousDataCollect.Tick
Dim BoxRECT As RECT
Dim ShipRECT As RECT
Dim TempRECT As RECT
Dim i As Integer
Dim x1 As Integer
Dim y1 As Integer
Dim z1 As Integer
Dim r1 As Integer
'Dim FailedBoost As Boolean
'Static Boosted As Boolean

PollJoystick()

If CurrentJoyX CenterX And HScrollBar1.Value < 250 Then
HScrollBar1.Value = HScrollBar1.Value + 1
x1 = HScrollBar1.Value + 25 'To prevent error
Label2.Text = x1.ToString
ExchangeInputAndOutputReports()
ElseIf CurrentJoyX < CenterX And HScrollBar1.Value 83 Then
HScrollBar1.Value = HScrollBar1.Value - 1
x1 = HScrollBar1.Value + 25
Label2.Text = x1.ToString
ExchangeInputAndOutputReports()

End If

If CurrentJoyY CenterY And HScrollBar2.Value < 250 Then
HScrollBar2.Value = HScrollBar2.Value + 1
y1 = HScrollBar2.Value + 25
Label3.Text = y1.ToString
ExchangeInputAndOutputReports()
ElseIf CurrentJoyY < CenterY And HScrollBar2.Value 83 Then
HScrollBar2.Value = HScrollBar2.Value - 1
y1 = HScrollBar2.Value + 25
Label3.Text = y1.ToString
ExchangeInputAndOutputReports()
End If

If CurrentJoyZ CenterZ And HScrollBar3.Value < 250 Then
HScrollBar3.Value = HScrollBar3.Value + 1
z1 = HScrollBar3.Value + 25
Label5.Text = z1.ToString
ExchangeInputAndOutputReports()
ElseIf CurrentJoyZ < CenterZ And HScrollBar3.Value 83 Then
HScrollBar3.Value = HScrollBar3.Value - 1
z1 = HScrollBar3.Value + 25
Label5.Text = z1.ToString
ExchangeInputAndOutputReports()
End If

If CurrentJoyR CenterR And HScrollBar4.Value < 250 Then
HScrollBar4.Value = HScrollBar4.Value + 1
r1 = HScrollBar4.Value + 25
Label7.Text = r1.ToString
ExchangeInputAndOutputReports()
ElseIf CurrentJoyR < CenterR And HScrollBar4.Value 83 Then
HScrollBar4.Value = HScrollBar4.Value - 1
r1 = HScrollBar4.Value + 25
Label7.Text = r1.ToString
ExchangeInputAndOutputReports()
End If

End Sub

TQ.
cson

url:http://www.ureader.com/gp/1444-1.aspx
Oct 31 '08 #1
0 3064

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter | last post by:
Hi I would like to get access to joystick information. Buttons, lever position. Is the easiest way throug DirectX? Which SDK should I need. An example would be great. Thanks. Peter.
1
by: Bleedledeep | last post by:
I am new to C#/.NET/DirectX, and could not find a simple example of how to read the X/Y location of the joystick. < YIKES!!! The DirectX.DirectInput is one serious pile of API! > After some...
2
by: PawelR | last post by:
Hello group, My English is very little. I want same samples about programming joysticks connected to USB port. If you can help me please send same adresses or samples. Thx PawelR
2
by: Regan Hurd | last post by:
I want to know how to have my visual basic .net program to be able to tell when a joystick button is pressed and raise an event? Thanks
2
by: Vicente Nicolau | last post by:
Is there any way to recieve events from a joystick and to hadle them using C#??? Without using pulling.... Thanks.
1
by: Vicente Nicolau | last post by:
All example codes I found with DirectX or XNA access the joystick by pulling... ?? is there anybody who has been able to use the joystick with events (with C#)?? Is it possible? If it is not...
2
by: Vicente Nicolau | last post by:
All example codes I found with DirectX or XNA access the joystick by pulling... ?? is there anybody who has been able to use the joystick with events (with C#)?? Is it possible? If it is not...
2
by: Jack Russell | last post by:
Does .net have support for this. I wrote some code to drive a model train under vb6 (I think I used a third party control) but cannot find anything under .net (or at least anything that makes sense...
1
by: 200dogz | last post by:
Hi, I have a Windows Form Application with one button and a textbox. How should I approach if I want the program to display the X value of a joystick plugged in the USB port of the PC when the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.