Skip to main content
gamedev.net
🔒 Locked

Mouse Input\Output

Started by naffets77 4 replies 900+ views
Original Post
naffets77
naffets77
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
mumpo
mumpo
Umm...are you sure you want mouse drivers? That is not the same thing as a mouse input handler.
naffets77
naffets77
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... ..
gunning
gunning
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.
....[size="1"]Brent Gunning
mumpo
mumpo
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.
naffets77
naffets77
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.