Sign in to follow this  

Resetting the mouse pointer.

This topic is 4745 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

I am making a first person style game but I have a problem looking around. When I move the mouse to far it hits the edge of the screen and I can’t turn any more. How can I avoid this problem so I can turn freely? I was thinking that I could some how reset the pointer to the center of the screen on every WM_MOUSEMOVE. But how do I do that? I spent 3 hours searching through MSDN to no avail.

Share this post


Link to post
Share on other sites
You can use SetCursorPos(X,Y) to set the cursor. So if your resolution was say 640x480, at the beginning of every frame just check if X>320 or X<320 and then call SetCursorPos(320,240) at the end of the frame.

Edit: Damn Prototype beat me to it.

Share this post


Link to post
Share on other sites

This topic is 4745 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this