1set_leds(3) Allegro manual set_leds(3)
2
3
4
6 set_leds - Sets the state of the keyboard LED indicators. Allegro game
7 programming library.
8
10 #include <allegro.h>
11
12
13 void set_leds(int leds);
14
16 Overrides the state of the keyboard LED indicators. The parameter is a
17 bitmask containing any of the values KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG,
18 and KB_CAPSLOCK_FLAG, or -1 to restore the default behavior. Example:
19
20 /* Cycle led indicators. */
21 set_leds(KB_SCROLOCK_FLAG);
22 rest(1000);
23 set_leds(KB_CAPSLOCK_FLAG);
24 rest(1000);
25 set_leds(KB_NUMLOCK_FLAG);
26 rest(1000);
27 set_leds(-1);
28
29 Note that the led behaviour cannot be guaranteed on some platforms,
30 some leds might not react, or none at all. Therefore you shouldn't rely
31 only on them to communicate information to the user, just in case it
32 doesn't get through.
33
34
36 install_keyboard(3), key_led_flag(3)
37
38
39
40Allegro version 4.2.2 set_leds(3)