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

Mouse confinement needs to be refactored #15

Open
macsforme opened this issue Jun 17, 2015 · 2 comments
Open

Mouse confinement needs to be refactored #15

macsforme opened this issue Jun 17, 2015 · 2 comments

Comments

@macsforme
Copy link
Member

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 macsforme added this to the 2.4.4 Release milestone Jun 17, 2015
@macsforme
Copy link
Member Author

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
Copy link

bz-next commented Feb 27, 2024

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

  • Hiding the mouse pointer
  • Drawing a "mouse pointer" in the window
  • Relocating the virtual pointer in the window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
BZFlag 2.6
  
To do
Status: Todo
Development

No branches or pull requests

2 participants