Search Unity

Bug No disconnection events on 1.4.4/Xbox Series controller/Windows 10

Discussion in 'Input System' started by Chaoszerom, May 27, 2023.

  1. Chaoszerom

    Chaoszerom

    Joined:
    May 24, 2017
    Posts:
    5
    Hey, having a bit of a weird issue. Setting up a game with Input System 1.4.4 on Unity 2021.3.15f1, and I'm looking into tracking controller disconnects and reconnects. However, I'm not receiving any InputDeviceChange disconnect or remove events, even when I receive add ones.

    Repro steps:
    • Connect controller (via Bluetooth)
    • Enter play mode
    • in Awake, sub to InputSystem.OnDeviceChanged
    • Switch off controller
    • No Removed or Disconnected events received
    • Switch controller back on
    • Added event received
    Each new "added" controller seems to have a distinct XInput name (like `XInputControllerWindows:/XInputControllerWindows3`, with the 3 incrementing) and a distinct InputDevice instance
     
  2. Chaoszerom

    Chaoszerom

    Joined:
    May 24, 2017
    Posts:
    5
    It looks like, after a few minutes, I do get the Disconnect event. That doesn't quite seem appropriate -- is it maybe a Windows/Bluetooth thing?