SFML community forums

Help => Window => Topic started by: wizbiz on July 01, 2011, 05:51:54 am

Title: Mouse moving off-screen to second monitor in fullscreen
Post by: wizbiz on July 01, 2011, 05:51:54 am
On my windows machine and regardless of resolution, when using full screen mode with two monitors side-by-side with the fullscreen window on Monitor 1... the mouse can just move off the right of the screen onto Monitor 2 when moved towards the edge.

Is this the intended behavior? Am I personally supposed to make sure that the mouse is contained? Just checking :)

Cheers,
wiz
Title: Mouse moving off-screen to second monitor in fullscreen
Post by: Hiura on July 01, 2011, 11:13:37 am
Yes, that's the normal behavior. You can reposition the cursor with something like
Code: [Select]
if (ev.Type == Event::MouseLeft) {
    win.SetCursorPosition(0, 0);
}


You can memorize the last know position of the mouse and put it back there fro example.
Title: Mouse moving off-screen to second monitor in fullscreen
Post by: wizbiz on July 01, 2011, 06:00:10 pm
Thankyou :-)