ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > General Discussion > Is there an ini setting for locking mouse to the window?
Is there an ini setting for locking mouse to the window?
  Author    Thread Reply to topic
lukeman3000
Got a warning


Joined: 17 Mar 2009
Posts: 29
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.

 Reply with quote  
Post Sat May 06, 2017 12:32 am 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 817
 

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/master/backends/events/sdl/sdl-events.cpp#L632
https://github.com/scummvm/scummvm/blob/master/backends/platform/sdl/sdl-window.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/master/backends/platform/sdl/sdl-window.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.

 Reply with quote  
Post Mon May 08, 2017 1:56 am 
 View user's profile Send private message
lukeman3000
Got a warning


Joined: 17 Mar 2009
Posts: 29
 

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?

 Reply with quote  
Post Thu Jun 15, 2017 7:25 am 
 View user's profile Send private message
digitall
ScummVM Developer


Joined: 02 Aug 2012
Posts: 817
 

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.

 Reply with quote  
Post Thu Jun 15, 2017 7:36 am 
 View user's profile Send private message
criezy
ScummVM Developer


Joined: 23 Sep 2006
Posts: 452
Location: West Sussex, UK
 

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.

 Reply with quote  
Post Thu Jun 15, 2017 7:38 am 
 View user's profile Send private message
lukeman3000
Got a warning


Joined: 17 Mar 2009
Posts: 29
 

quote:
Originally posted 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.

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.
 Reply with quote  
Post Thu Jun 15, 2017 2:38 pm 
 View user's profile Send private message
abelthorne



Joined: 02 Jun 2006
Posts: 43
Location: France
 

quote:
Originally posted by digitall
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/master/backends/platform/sdl/sdl-window.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.)
 Reply with quote  
Post Wed Sep 13, 2017 3:22 pm 
 View user's profile Send private message
lukeman3000
Got a warning


Joined: 17 Mar 2009
Posts: 29
 

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?

 Reply with quote  
Post Wed Oct 04, 2017 4:08 am 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge