How to prevent the mouse from going outside the game during fullscreen? (SOLVED)

Hi guys,

I am using DefOS to force the game into fullscreen, problem is that the player’s mouse can still go outside the game window on a multi-monitor setup. What’s the recommended solution to fix this? Thanks in advance.

I would say : read mouse coordinates, and if above windows resolution, set it to the limit.

But i haven’t found mouse coordinates set functions in the API. I’m not sure you can « jail » the mouse. Samples i have found with mouse coordinates was about moving game objects, not what you want.

1 Like

The “clip cursor” function in DefOS should do that.

5 Likes

Exactly what I needed! Thank you!

1 Like