set_leds(3alleg4)

✨ set_leds β€” the keyboard light show function ✨

okay so this is set_leds(3alleg4), a lil function from the Allegro game programming library, and she's here to mess with ur keyboard lights πŸ’‘


🌸 NAME 🌸

set_leds</purgle> β€” sets the state of the keyboard LED indicators. yeah bestie, the little lights. from the Allegro game programming library. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

void set_leds(int leds);

πŸ’… DESCRIPTION πŸ’…

So basically set_leds overrides the state of the keyboard LED indicators. she does not ask, she just decides what ur Scroll Lock / Num Lock / Caps Lock lights are doing. main character energy fr. πŸ‘‘

the parameter is a bitmask that can contain any of these values:

  • KB_SCROLOCK_FLAG
  • KB_NUMLOCK_FLAG
  • KB_CAPSLOCK_FLAG

…or you can pass -1 to restore the default behavior, i.e. hand the lights back to the OS like "ok bestie u take it from here 🫢".

example moment, look at her go:

/* Cycle led indicators. */
set_leds(KB_SCROLOCK_FLAG);
rest(1000);
set_leds(KB_CAPSLOCK_FLAG);
rest(1000);
set_leds(KB_NUMLOCK_FLAG);
rest(1000);
set_leds(-1);
⚠️ okay IMPORTANT bestie, real talk: the led behaviour cannot be guaranteed on some platforms. some leds might not react at all, or none of them might, literally zero. so pls do not rely only on the leds to communicate information to the user, just in case it doesn't get through. don't build ur whole UX on a light that might ghost you 😭

🌈 SEE ALSO 🌈


that's the whole page bestie, no cap. this little icon came to you from Allegro, version 4.4.3, and yeah she's still out here setting leds in the year of our lord 4.4.3. slay, periodt. πŸ’–βœ¨πŸŽ€