# Joystick improvements

**URL:** https://forum.castle-engine.io/t/joystick-improvements/127
**Category:** News
**Created:** [March 1, 2020, 8:57pm UTC](https://forum.castle-engine.io/t/joystick-improvements/127 "2020-03-01T20:57:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [March 1, 2020, 8:57pm UTC](https://forum.castle-engine.io/t/joystick-improvements/127/1 "2020-03-01T20:57:22Z")

</div>

| [![Joysticks demo in Castle Game Engine](https://castle-engine.io/wp/wp-content/uploads/2020/03/joysticks_demo-200x117.png)](https://castle-engine.io/wp/wp-content/uploads/2020/03/joysticks_demo.png "Joysticks demo in Castle Game Engine") |

Thanks to _Eugene Loza_ work on the [Steam release of “The Unholy Society”](https://unholy-society.com/), you can now detect when joystick is being connected or disconnected.

Simply assign your own event to [Joysticks.OnConnect](https://castle-engine.io/apidoc-unstable/html/CastleJoysticks.TJoysticks.html#OnConnect) and [OnDisconnect](https://castle-engine.io/apidoc-unstable/html/CastleJoysticks.TJoysticks.html#OnDisconnect).

By default nothing is done. But you can call e.g. [Joysticks.Initialize](https://castle-engine.io/apidoc-unstable/html/CastleJoysticks.TJoysticks.html#Initialize) to reinitialize joysticks, thus automatically accounting for the newly connected or disconnected joysticks. A demo of it is inside our [examples/joystick/ application](https://github.com/castle-engine/castle-engine/tree/master/examples/joystick).

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.
