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

Relative mouse motion #774

Closed
bvssvni opened this issue May 9, 2016 · 6 comments
Closed

Relative mouse motion #774

bvssvni opened this issue May 9, 2016 · 6 comments

Comments

@bvssvni
Copy link
Contributor

bvssvni commented May 9, 2016

This is needed for FPS games.

The old issue was here, but closed because piston-input was considered.

@bvssvni
Copy link
Contributor Author

bvssvni commented May 20, 2016

From IRC:

fkaa: bvssvni: just checked, deltaX/deltaY works when the mouse is grabbed (CGAssociateMouseAndMouseCursorPosition(false))

@retep998
Copy link
Contributor

From PistonDevelopers/hematite#265

For future reference of anyone who does decide to work on this you use RegisterRawInputDevices to register a device for raw input, and then you receive WM_INPUT messages through the normal message loop.

@LukasKalbertodt
Copy link

What is the status of this?

I'm a bit confused that this feature is not implemented in glutin yet. There are quite a few games using this library and quite a few of those need some kind of mouse grabbing with relative motion, I presume 😉

I know that this behavior can be simulated rather easy, but it's a bit of a hack. I also think that most OS-APIs can provide floating point relative movements (instead of being restricted to pixels).

So: any progress on this?

@Limeth
Copy link

Limeth commented Sep 3, 2016

Any updates on this? I am interested in a solution.
I currently use this piece of code, but as you may imagine, it's kind of buggy. The behavior is inconsistent across different platforms (tested on linux/windows). https://github.com/Limeth/euclider/blob/76bc8d4482bf5e84ef309b32efbdcb0ed7840f08/src/simulation.rs#L242

@bvssvni
Copy link
Contributor Author

bvssvni commented Sep 3, 2016

The glutin_window backend to Piston also works around this problem https://github.com/PistonDevelopers/glutin_window/blob/master/src/lib.rs#L216

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2016

Closing for rust-windowing/winit#70

@tomaka tomaka closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants