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: 16
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: 793
 

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