---
name: "SDL_EnableKeyRepeat"
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_EnableKeyRepeat"
---

# SDL\_EnableKeyRepeat(3)

Set keyboard repeat rate.

## NAME

SDL\_EnableKeyRepeat - Set keyboard repeat rate.

## SYNOPSIS

**#include "SDL.h"**

**int SDL\_EnableKeyRepeat**(**int delay, int interval**);

## DESCRIPTION

Enables or disables the keyboard repeat rate. **delay** specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by **interval**. Both **delay** and **interval** are expressed in milliseconds.

Setting **delay** to 0 disables key repeating completely. Good default values are **SDL\_DEFAULT\_REPEAT\_DELAY** and *SDL\_DEFAULT\_REPEAT\_INTERVAL*.

## RETURN VALUE

Returns **0** on success and **-1** on failure.
