AL_RECONFIGURE_JOYSTICKS(3)
π NAME π
Hey bestie, welcome to al_reconfigure_joysticks(3) β brought to you by the Library Functions Manual. This one is al_reconfigure_joysticks, aka the Allegro 5 API glow-up for your joystick lineup π
π SYNOPSIS π
#include <allegro5/allegro.h>
bool al_reconfigure_joysticks(void)
πΈ DESCRIPTION πΈ
Okay so Allegro is built to cope with users plugging in and unplugging joystick devices on-the-fly β yes, while everything is running, no big production. On existing platforms, the joystick event source will generate an event of type ALLEGRO_EVENT_JOYSTICK_CONFIGURATION when a device gets plugged in or unplugged. When that happens, your move is to call al_reconfigure_joysticks(3). That's the assignment π
Afterwards, the number returned by al_get_num_joysticks(3) may be different, and the handles returned by al_get_joystick(3) may be different or be ordered differently. So if the lineup shuffled, that's expected β no cap.
All ALLEGRO_JOYSTICK(3) handles remain valid, but handles for disconnected devices become inactive: their states will no longer update, and al_get_joystick(3) will not return the handle. Handles for devices which remain connected will continue to represent the same devices. Previously inactive handles may become active again, being reused to represent newly connected devices. Reuse era, honestly.
Returns true if the joystick configuration changed, otherwise returns false. Literally the vibe check of return values β¨
It is possible that on some systems, Allegro wonβt be able to generate ALLEGRO_EVENT_JOYSTICK_CONFIGURATION events. If your game has an input configuration screen or similar, you may wish to call al_reconfigure_joysticks(3) when entering that screen. Little safety-net behavior, iykyk π«Ά
π¦ SEE ALSO π¦
That's the whole tea, bestie π β source: the Allegro reference manual, and this page is undated, so she's giving timeless icon energy, periodt π β¨
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms