Joystick improvements

Joysticks demo in Castle Game Engine

Thanks to Eugene Loza work on the Steam release of “The Unholy Society”, you can now detect when joystick is being connected or disconnected.

Simply assign your own event to Joysticks.OnConnect and OnDisconnect.

By default nothing is done. But you can call e.g. Joysticks.Initialize to reinitialize joysticks, thus automatically accounting for the newly connected or disconnected joysticks. A demo of it is inside our examples/joystick/ application.

In games where joystick support is essential, or in “multi-player games on a single device” (many people playing on a single computer with multiple joysticks connected) you can use these events to automatically pause the game, display the player configuration screen etc.

1 Like