Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to lock cursor to window?  (Read 1844 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 29
    • AOL Instant Messenger - Clairvoire
    • View Profile
    • http://clairvoire.deviantart.com
How to lock cursor to window?
« 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.


  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: How to lock cursor to window?
« Reply #1 on: April 30, 2016, 02:35:09 pm »
SFML / OS X developer