Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwanted mouse acceleration #204

Open
sector-f opened this issue Aug 23, 2017 · 2 comments
Open

Unwanted mouse acceleration #204

sector-f opened this issue Aug 23, 2017 · 2 comments

Comments

@sector-f
Copy link

I'm currently working on mouselook for a first-person game. I am doing this by calling set_capture_cursor(true) on the PistonWindow, and then checking the cursor change via Input::Move(Motion::MouseRelative(x, y)) events.

My problem with this is that it has mouse acceleration—The amount the player rotates is controlled not only by how far the mouse is moved, but by how quickly it is moved as well. Is there some way to make it so that the distance the mouse physically moves is the only thing that affects player rotation?

I'll also point out that the different window backends don't all behave the same. GlutinWindow seemed to have some sort of "buffering", so to speak. If I quickly moved the mouse left then right, the player continued to rotate left before rotating right. As someone who's been playing first-person shooters for the majority of his life...it felt "wrong". Using the Sdl2Window and GlfwWindow backends felt more "right", but they still had the undesired mouse acceleration.

@sector-f
Copy link
Author

Update: this may not be as much of an issue as I thought. It turns out that my system did actually have some mouse acceleration already. Disabling it seems to have resolved my main complaint (although my problem with GlutinWindow still stands).

However, I still think there is room for improvement. Currently the cursor's change in movement is being used, which means game movement is tied to how the OS treats the mouse. This means it would be impossible to disable acceleration in-game if the OS has mouse acceleration enabled. I think there should be some way to get input from the mouse directly rather than listen to what the OS says about the cursor's movement.

@bvssvni
Copy link
Member

bvssvni commented Aug 26, 2017

You could normalize the relative mouse motion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants