SDL_EnableKeyRepeat(3)

πŸ’– SDL_EnableKeyRepeat πŸ’–

okay bestie, welcome to the SDL API Reference β€” this one's SDL_EnableKeyRepeat(3) and it's literally about making your keyboard go brrrrr when you hold a key down. 🎹✨


✨ NAME ✨

SDL_EnableKeyRepeat β€” set the keyboard repeat rate, periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "SDL.h"

int SDL_EnableKeyRepeat(int delay, int interval);

🌸 DESCRIPTION 🌸

So what this does is it enables or disables the keyboard repeat rate. Groundbreaking, i know. πŸ™ˆ

Here's the tea tho:

  • delay is how long the key has to be pressed before it starts repeating. it's giving "how long do i gotta hold this before you notice me" energy. 😭
  • after that lil wait is up, it repeats at the speed set by interval.

Both delay and interval are in milliseconds, bestie. don't forget. fr fr. ⏱️

And here's the important bit: if you set delay to 0, key repeating gets disabled completely. like, gone. no repeats. nada. πŸ’€

Wanna know the good default values? They're SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL. slay. use those if you don't wanna think about it. πŸ‘‘


🌈 RETURN VALUE 🌈

  • Returns 0 on success 🫢
  • Returns -1 on failure 😭

that's it. that's the whole vibe check.


and that's a wrap on the SDL API Reference, gorgeous. this page came from SDL, dated Tue 11 Sep 2001, 22:59 β€” yes, the date is doing vintage main character energy, we respect it. go forth and repeat responsibly. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from