Search Unity

Bug PS4 Controller getting identified as a Mouse when connected at Runtime

Discussion in 'Input System' started by ryanjay100, Jan 24, 2023.

  1. ryanjay100

    ryanjay100

    Joined:
    Dec 16, 2021
    Posts:
    4
    Hello everyone,

    after a long time of debugging i've come to the conclusion that this is perhaps a bug in Unity's input system or perhaps an android OS bug?

    the PS4 controller gets identified as a Gamepad correctly when the controller is connected before the app is launched. Otherwise, Gets identified as a Mouse when connected at Runtime.

    I logged the Input Device details OnDeviceStateChange() and that's where I found out that its being identified incorrectly.

    I have tried using RegisterLayoutMatcher() and tried forcing the Gamepad class unto the Mouse class but controls still won't go through as the deviceClass of the Input Device is still a "Mouse"

    (PS4 controller with Incorrect deviceClass png)
    upload_2023-1-24_15-39-27.png

    (PS4 controller with Correct deviceClass png)
    upload_2023-1-24_15-39-38.png


    I doubt that this very obvious edge case is a bug in the Input System, but is this not a bug?
    TIA