---
name: "SDL_WM_GrabInput"
section: "3"
platform: "linux"
package: "libsdl1.2-dev"
version: "1.2.15+dfsg2-8"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_WM_GrabInput"
---

# SDL\_WM\_GrabInput(3)

Grabs mouse and keyboard input.

## NAME

SDL\_WM\_GrabInput - Grabs mouse and keyboard input.

## SYNOPSIS

**#include "SDL.h"**

**SDL\_GrabMode SDL\_WM\_GrabInput**(**SDL\_GrabMode mode**);

## DESCRIPTION

Grabbing means that the mouse is confined to the application window, and nearly all keyboard input is passed directly to the application, and not interpreted by a window manager, if any.

When **mode** is **SDL\_GRAB\_QUERY** the grab mode is not changed, but the current grab mode is returned.

```
typedef enum {
  SDL_GRAB_QUERY,
  SDL_GRAB_OFF,
  SDL_GRAB_ON
} SDL_GrabMode;
```

## RETURN VALUE

The current/new **SDL\_GrabMode**.
