---
name: "al_reconfigure_joysticks"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_reconfigure_joysticks/3alleg5"
---

# al\_reconfigure\_joysticks(3alleg5)

Allegro 5 API

## NAME

al\_reconfigure\_joysticks - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  bool al_reconfigure_joysticks(void)
  ```

## DESCRIPTION

Allegro is able to cope with users connecting and disconnected joystick devices on-the-fly. On existing platforms, the joystick event source will generate an event of type `ALLEGRO_EVENT_JOYSTICK_CONFIGURATION` when a device is plugged in or unplugged. In response, you should call al\_reconfigure\_joysticks(3alleg5).

Afterwards, the number returned by al\_get\_num\_joysticks(3alleg5) may be different, and the handles returned by al\_get\_joystick(3alleg5) may be different or be ordered differently.

All ALLEGRO\_JOYSTICK(3alleg5) handles remain valid, but handles for disconnected devices become inactive: their states will no longer update, and al\_get\_joystick(3alleg5) 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.

Returns true if the joystick configuration changed, otherwise returns false.

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(3alleg5) when entering that screen.

## SEE ALSO

al\_get\_joystick\_event\_source(3alleg5), ALLEGRO\_EVENT(3alleg5)
