Jump to content
  • Advertisement
Sign in to follow this  
naffets77

Mouse Input\Output

This topic is 4858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know where I can get the source code for a mouse driver? Also, does anyone know any good tutorials in C or Assembly or both for Input\Output for mice? And and, if anyone has any experience with writing code for mouse drivers, or if theres any information about it online that would be great too.. Thanks lots

Share this post


Link to post
Share on other sites
Advertisement
Umm...are you sure you want mouse drivers? That is not the same thing as a mouse input handler.

Share this post


Link to post
Share on other sites
What I need is an example of how to control a mouse. I figured that the mouse drivers would include that...I dunno hard to explain. Just need to understand how to write code to effect the cursor with a mouse... ..

Share this post


Link to post
Share on other sites
Well to start, what operating system are you working on? Because writing windows drivers is very different than writing linux drivers.

Second, would you please explain in more detail what you are trying to do? Because if all you want to do is control the position of the cursor, then you can do this using standard API calls on practically any OS.

Finally, I will assume that you desire to write windows drivers. The Microsoft DDK is the place to start and Google Groups is invaluable when you have questions. Drivers are not trivial.

Best of luck.

Share this post


Link to post
Share on other sites
You might try looking up these on MSDN (assuming you are using Win32):
BOOL SetCursorPos(int X, int Y)
BOOL GetCursorPos(LPPOINT lpPoint)
I think they are pretty much what you are looking for. Depending on what you are doing, you may also find these functions helpful in using the ones above:
BOOL ScreenToClient(HWND hWnd, LPPOINT lpPoint)
BOOL ClientToScreen(HWND hWnd, LPPOINT lpPoint)
If those don't help, you'll have to explain what you want to do in more detail.

Share this post


Link to post
Share on other sites
Thanks for the info so far, the functions look promising. I'm working in windows xp, but thats not really what I need the code for.

Basically what i'm trying to do is figure out how to write code for a device that will be used on the xbox and playstation2 and computer that is used as a virtual 3d headset. The headset works wtih a gyro so that when you move your head to the left or right, the cursor.. or..screen image follows.

Now my dad who's the engineer (i'm the budding programmer) has a chip burner. I need (if possible) to write the code that will interface betweeen this chip, a gyro, and the machine\console. I really don't know if im in over my head trying to figure this out, but I figured i might as well see what kind of resources I could find for building the code for the device.

Anyway, so first I need to figure out how to code basic mousemovements for moving the cursor around the screen. Then i have to tie those into the gyro allowing for the gyro to control the movement. The gyro has it's own special functions that are hardwired in that i allready have.. but I don't know how to write anything for a mouse in the first place..


So hopefully that helps give an idea of what i'm trying to do. I still need to check out whats been posted so far, but yah, any more tips would be great.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!