Click here to Skip to main content
15,946,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm planning to create a VB.NET interface to determine a mobile robot's position using the USB laser mouse to get the movement. I have tried using VB.NET 'cursor.position' function but it is not able to give mouse position beyond the windows border.

I have used the mcHID.dll plugin (something like in this website - http://digital-diy.com/forum/visual-basic/ihid-t288.html[^]) to get the HID report of a USB joystick. When I tried the same to a USB mouse, I'm not getting any report. It only shows that that device is connected. Is there another way to get the USB mouse HID report on VB.NET? Please point me in the right direction.

Thank you.
Posted

1 solution

The "poor man's" way to do it would be to reset the mouse pointer to the center of the screen every time you get it's values. You can work out the rough direction the robot was going and how far using the previous points and the new data. Though, like inertial navigation, the small amount of error in every sample due to resolution limitations will add up over time.
 
Share this answer
 
Comments
neohimura 5-Apr-11 3:50am    
When I do this code and run it, the form will be stuck. Did I do it wrongly?


Private Sub MainForm_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove


Cursor.Position = New Point(1055, 511)

End Sub

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900