SFML community forums

Help => Window => Topic started by: Clairvoire on April 30, 2016, 12:07:30 pm

Title: How to lock cursor to window?
Post by: Clairvoire on April 30, 2016, 12:07:30 pm
Is there a way to lock the mouse cursor to the window with SFML, such that when the mouse is about the exit the window's border, it is stopped?  Setting the mouse location isn't very reliable, as it fails when the mouse's movement is great enough (or if the program hangs briefly and delays the reset) allowing the mouse to escape and the window to lose focus.



Title: Re: How to lock cursor to window?
Post by: Hiura on April 30, 2016, 02:35:09 pm
https://github.com/SFML/SFML/pull/614 --> in need of testers