BZFlag-Dev / bzflag

3D multi-player tank battle game
https://www.bzflag.org
Other
291 stars 79 forks source link

Mouse confinement needs to be refactored #15

Open macsforme opened 9 years ago

macsforme commented 9 years ago

The mouse is currently restricted to the window when Options->Input Settings->Confine Mouse->Window is set. This appears to be in effect at all times. By contrast, when Confine Mouse->MotionBox is set, the mouse is confined to the mouse box only while playing, and a player may release the mouse temporarily by holding down ctrl. Confinement to the motionbox appears to be accomplished by taking the mouse position and warping it. On some platforms, there are reports that if the mouse escapes the window or motionbox (probably between frames), it remains there until moved back into the window. Additionally, because the mouse can escape the window, we currently require the use of the SDL_CaptureMouse() (which is not in any official releases of SDL 2 yet) function when using SDL 2, because motion events outside the window are not reported.

The desired behavior is for the mouse to be confined, whether to the window or to the motionbox, only while playing, and for it to work consistently across all platforms. We would also like to remove our dependency on SDL_CaptureMouse(), which could be accomplished by having the window grab the mouse when in confine to motionbox mode also.

macsforme commented 9 years ago

A few enhancements were made by @blast007, but further changes were found to be too invasive for a point release. Moving to the 2.6 milestone.

bz-next commented 6 months ago

Note that on Wayland, I believe, it is not possible to forcibly relocate the mouse pointer. The solutions I've seen for this involve: