Is there an ini setting for locking mouse to the window?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
lukeman3000
Got a warning
Posts: 29
Joined: Tue Mar 17, 2009 1:50 am

Is there an ini setting for locking mouse to the window?

Post by lukeman3000 »

I know that ctrl+m accomplishes this but I'm wondering if there's a way to make this the default behavior.
digitall
ScummVM Developer
Posts: 1177
Joined: Thu Aug 02, 2012 1:40 pm

Post by digitall »

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.
lukeman3000
Got a warning
Posts: 29
Joined: Tue Mar 17, 2009 1:50 am

Post by lukeman3000 »

Thanks for the detailed reply.

How do I submit a request for this? I am wholly unfamiliar with github. Is there a thread somewhere on these forums for requests like these?
digitall
ScummVM Developer
Posts: 1177
Joined: Thu Aug 02, 2012 1:40 pm

Post by digitall »

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.
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Post by criezy »

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.
lukeman3000
Got a warning
Posts: 29
Joined: Tue Mar 17, 2009 1:50 am

Post by lukeman3000 »

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.
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.
User avatar
abelthorne
Posts: 43
Joined: Fri Jun 02, 2006 11:50 am
Location: France

Post by abelthorne »

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
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?

(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.)
lukeman3000
Got a warning
Posts: 29
Joined: Tue Mar 17, 2009 1:50 am

Post by lukeman3000 »

Does anyone know how I might go about checking the status of the mouse cursor and whether or not it is locked to the window or not within an AutoHotkey script?
Post Reply