Scroll to navigation

SDL_SetWindowMouseGrab(3) SDL3 FUNCTIONS SDL_SetWindowMouseGrab(3)

NAME

SDL_SetWindowMouseGrab - Set a window's mouse grab mode.

SYNOPSIS

#include "SDL3/SDL.h"
int SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);

DESCRIPTION

Mouse grab confines the mouse cursor to the window.

FUNCTION PARAMETERS

The window for which the mouse grab mode should be set.
This is SDL_TRUE
to grab mouse, and SDL_FALSE
to release.

RETURN VALUE

Returns 0 on success or a negative error code on failure; call

SDL_GetError () for more information.

AVAILABILITY

This function is available since SDL 3.0.0.

SEE ALSO

SDL_GetWindowMouseGrab(3), SDL_SetWindowKeyboardGrab(3), SDL_SetWindowGrab(3)

SDL 3.1.0 SDL