#545 closed defect (fixed)
Grab mouse in fullscreen
Reported by: | Jay Weisskopf | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 2 |
Component: | Core engine | Keywords: | multimon |
Cc: | Patch: |
Description
When the game is running in fullscreen, the mouse should be grabbed so it cannot move outside the game. I have multiple monitors, so when I try to pan the camera by putting the cursor along the edges, it moves right into the next monitor, which is a major annoyance.
Attached is a patch to fix the issue.
The ideal functionality for mouse grabbing would probably be to have it always grabbed in fullscreen, and optionally grabbed during gameplay in windowed mode (but not on menus, dev console, text entry, etc). I can also implement this if desired (it'd be a good way for me to start getting my feet wet).
Attachments (1)
Change History (11)
by , 14 years ago
Attachment: | mouse_grab.patch added |
---|
comment:1 by , 14 years ago
Keywords: | review added |
---|
comment:2 by , 14 years ago
See #508 for a similar issue. That was from before r7686 implemented SDL_WM_GrabInput
on Windows - seems good to use that function now we have it.
What platforms have you tested this on? On Windows, does it avoid the bugs mentioned in a comment on that ticket? (I'd prefer to fix them or at least be fully aware of them before committing the change.)
comment:3 by , 14 years ago
Yes, using SDL_WM_GrabInput is better than modifying the functionality of SDL_Set_VideoMode. The SDL emulation should adhere as closely to native SDL as possible. (I'm quite puzzled as to why you're even emulating it, but that's a discussion for IRC or the forum.)
I recommend you commit my patch, just so the major annoyance is gone, and close this issue. I will assign myself to #508 and produce another patch that takes care of any edge cases (alt+tab, stuff like that).
comment:4 by , 14 years ago
Oh, I forgot to mention that this has only been tested on Windows, but if you're using native SDL on the other platforms, there shouldn't be any issues. I've done some work on this exact same issue for another project, which is SDL-based, so I'm comfortable with its API.
comment:5 by , 14 years ago
Okay, I'll commit this one for now. I tried it on OS X and it looks like fullscreen is already pretty broken and this doesn't make it any worse, so I'll leave those problems for some competent Mac developer to come and fix. Multi-monitor fullscreen on Linux doesn't work (it fills the bounding box of all monitors; I think that's SDL's responsibility, not ours) so this doesn't have any effect there so that's okay.
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 by , 11 years ago
Keywords: | multimon added |
---|---|
Milestone: | → Backlog |
comment:9 by , 11 years ago
Keywords: | review removed |
---|---|
Milestone: | Backlog → Alpha 2 |
Patch for grabbing mouse when game is fullscreen.