SDL_HasKeyboard(3)

πŸ’– SDL_HasKeyboard(3) β€” SDL3 FUNCTIONS πŸ’–

okay bestie, welcome to the SDL_HasKeyboard(3) page from the SDL3 FUNCTIONS manual. it's short, it's sweet, it's giving "do you have a keyboard plugged in?" energy. let's go 🫢


✨ NAME ✨

SDL_HasKeyboard β€” return whether a keyboard is currently connected. like, right now. present tense. no cap. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_keyboard.h>

bool SDL_HasKeyboard(void);

that's the whole vibe. include the header, call the function, get a bool back. slay. ✨


πŸŽ€ RETURN VALUE πŸŽ€

Returns true if a keyboard is connected, and false otherwise.

so: true = keyboard bestie is here πŸ’…, false = no keyboard detected 😭. simple as that.


🧡 THREAD SAFETY 🧡

🚨 Only call this on the main thread. not a background thread, not a side thread, not a "but i thought it would be fine" thread. main thread. periodt. πŸ’€

πŸ—“οΈ AVAILABILITY πŸ—“οΈ

This function is available since SDL 3.2.0. if you're kicking it with an older SDL, this one is not in the group chat yet. πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

go peek at that one too, iykyk. πŸ’œ


mwah πŸ’‹ β€” this came from Simple Directmedia Layer, version SDL 3.4.18, and the page signs off as SDL_HasKeyboard(3). the footer didn't print a date, bestie, so i'm not inventing one 🫢🌸

πŸ“¦ where this page comes from