Added ability to grab the cursor (w/ Windows impl.)

* When grabbed, the mouse cursor may not be moved outside a window's client frame.
 * Fullscreen windows always grab the mouse cursor.
 * The effect is only active while the SFML window is the active
foreground window.
 * Right now this is only implemented for Windows.

Signed-off-by: Marco Antognini <antognini.marco@gmail.com>
This commit is contained in:
Mario Liebisch 2014-05-01 21:08:57 +02:00 committed by Lukas Dürrenberger
parent ba9383f25e
commit f7dcc10a70
10 changed files with 166 additions and 8 deletions

View file

@ -348,6 +348,21 @@ public:
////////////////////////////////////////////////////////////
void setMouseCursorVisible(bool visible);
////////////////////////////////////////////////////////////
/// \brief Grab or release the mouse cursor
///
/// If set, grabs the mouse cursor inside this window's client
/// area so it may no longer be moved outside its bounds.
/// Note that grabbing is only active while the window has
/// focus and calling this function for fullscreen windows
/// won't have any effect (fullscreen windows always grab the
/// cursor).
///
/// \param grabbed True to enable, false to disable
///
////////////////////////////////////////////////////////////
void setMouseCursorGrabbed(bool grabbed);
////////////////////////////////////////////////////////////
/// \brief Enable or disable automatic key-repeat
///