Is there an ini setting for locking mouse to the window?
Moderator: ScummVM Team
-
- Got a warning
- Posts: 29
- Joined: Tue Mar 17, 2009 1:50 am
Is there an ini setting for locking mouse to the window?
I know that ctrl+m accomplishes this but I'm wondering if there's a way to make this the default behavior.
For ScummVM ports with SDL backends, CTRL-m (on desktop ports or other ports with keyboards) will toggle mouse grab i.e. confine the mouse pointer to window:
https://wiki.libsdl.org/SDL_SetWindowGrab
The relevant code for this in ScummVM is here:
https://github.com/scummvm/scummvm/blob ... s.cpp#L632
https://github.com/scummvm/scummvm/blob ... w.cpp#L124
As far as I can see, this takes the SDL default which I think is ungrabbed for Windowed and grabbed for Fullscreen:
https://github.com/scummvm/scummvm/blob ... ow.cpp#L33
If you are running in Windowed mode, then there is no configuration file option to grab the mouse by default currently.
Feel free to submit a patches or Github Pull Request to implement this and it will be reviewed and likely incorporated.
https://wiki.libsdl.org/SDL_SetWindowGrab
The relevant code for this in ScummVM is here:
https://github.com/scummvm/scummvm/blob ... s.cpp#L632
https://github.com/scummvm/scummvm/blob ... w.cpp#L124
As far as I can see, this takes the SDL default which I think is ungrabbed for Windowed and grabbed for Fullscreen:
https://github.com/scummvm/scummvm/blob ... ow.cpp#L33
If you are running in Windowed mode, then there is no configuration file option to grab the mouse by default currently.
Feel free to submit a patches or Github Pull Request to implement this and it will be reviewed and likely incorporated.
-
- Got a warning
- Posts: 29
- Joined: Tue Mar 17, 2009 1:50 am
See https://help.github.com/articles/about-pull-requests/ for GitHub pull request. This is something you would use if you can implement the code modification yourself and would like the change to be included in the official ScummVM.
Otherwise you can use https://bugs.scummvm.org/ to make enhancement requests.
Otherwise you can use https://bugs.scummvm.org/ to make enhancement requests.
-
- Got a warning
- Posts: 29
- Joined: Tue Mar 17, 2009 1:50 am
Ah. Well, had I the knowledge I would gladly write it myself, but I do not. I may submit as a feature request in lieu of this.digitall wrote:A Git(hub) Pull Request is a way to incorporate code you have written, similar to applying a patch.
I assume you are confusing this with a "Feature Request".
I meant that you are free to write this code _yourself_ and submit it to the project for consideration to be included in future releases.
- abelthorne
- Posts: 43
- Joined: Fri Jun 02, 2006 11:50 am
- Location: France
On my Linux setup (Ubuntu MATE 17.04), it's ungrabbed in fullscreen too, not sure if it's normal? I assume that pressing alt + Enter does not trigger a real fullscreen but a windowed one to avoid resolution issues, so that might explain this, I guess? Or is it supposed to grab the mouse also in that case?digitall wrote:As far as I can see, this takes the SDL default which I think is ungrabbed for Windowed and grabbed for Fullscreen:
https://github.com/scummvm/scummvm/blob ... ow.cpp#L33
(I need to grab the mouse because I have a dual screen setup and when moving the mouse on the right side in fullscreen, I can see the pointer move to the other screen.)
-
- Got a warning
- Posts: 29
- Joined: Tue Mar 17, 2009 1:50 am