1al_reconfigure_joysticks(3) al_reconfigure_joysticks(3)
2
3
4
6 al_reconfigure_joysticks - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 bool al_reconfigure_joysticks(void)
12
14 Allegro is able to cope with users connecting and disconnected joystick
15 devices on-the-fly. On existing platforms, the joystick event source
16 will generate an event of type ALLEGRO_EVENT_JOYSTICK_CONFIGURATION
17 when a device is plugged in or unplugged. In response, you should call
18 al_reconfigure_joysticks(3).
19
20 Afterwards, the number returned by al_get_num_joysticks(3) may be dif‐
21 ferent, and the handles returned by al_get_joystick(3) may be different
22 or be ordered differently.
23
24 All ALLEGRO_JOYSTICK(3) handles remain valid, but handles for discon‐
25 nected devices become inactive: their states will no longer update, and
26 al_get_joystick(3) will not return the handle. Handles for devices
27 which remain connected will continue to represent the same devices.
28 Previously inactive handles may become active again, being reused to
29 represent newly connected devices.
30
31 Returns true if the joystick configuration changed, otherwise returns
32 false.
33
34 It is possible that on some systems, Allegro won't be able to generate
35 ALLEGRO_EVENT_JOYSTICK_CONFIGURATION events. If your game has an input
36 configuration screen or similar, you may wish to call al_reconfig‐
37 ure_joysticks(3) when entering that screen.
38
40 al_get_joystick_event_source(3), ALLEGRO_EVENT(3)
41
42
43
44Allegro reference manual al_reconfigure_joysticks(3)