From e3e63c9886f58ad0a23688371b8c40cf68efae7e Mon Sep 17 00:00:00 2001 From: Alex Tyrer Date: Tue, 10 Sep 2024 12:15:33 +0100 Subject: [PATCH 1/2] [InputSystem] Fix for generic DualShock4 InputDeviceMatcher claiming DualSense devices too! o The generic DualShock4GamepadHID InputDeviceMatcher would erroneously claim to match DualSense devices based on the simplistic count of how many properties match. o The previous regex removal change added another WithManufacturerContains() which increased their score when comparing against DualSense controllers making the DualShock4 the best match. o Removing the additional property match restores the original behaviour. o DualShock3GamepadHID has also been fixed here. o These generic matchers are problematic and were only added to work around a defect in an older version of OSX when connecting over Bluetooth where no product or vendor were reported. This defect is no longer present on MacOS but these matchers are kept to support off-brand devices. o Ideally we could weight VID and PID properties more heavily. --- .../InputSystem/Plugins/DualShock/DualShockSupport.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockSupport.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockSupport.cs index 851b3bb734..f7d8705798 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockSupport.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockSupport.cs @@ -54,7 +54,6 @@ public static void Initialize() new InputDeviceMatcher() .WithInterface("HID") .WithManufacturerContains("Sony") - .WithManufacturerContains("Entertainment") .WithProduct("Wireless Controller")); InputSystem.RegisterLayout( @@ -67,7 +66,6 @@ public static void Initialize() new InputDeviceMatcher() .WithInterface("HID") .WithManufacturerContains("Sony") - .WithManufacturerContains("Entertainment") .WithProduct("PLAYSTATION(R)3 Controller", supportRegex: false)); #endif } From 659031078401e429dec8128552135317c9d9228c Mon Sep 17 00:00:00 2001 From: Alex Tyrer Date: Tue, 10 Sep 2024 12:25:06 +0100 Subject: [PATCH 2/2] Added CHANGELOG entry for FIX: DualSense controllers being recognized as DualShock4 --- Packages/com.unity.inputsystem/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 69b81d5db2..f141e7e32b 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -19,6 +19,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed 'OnDrop' event not called when 'IPointerDownHandler' is also listened. [ISXB-1014](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1014) - Fixed InputSystemUIInputModule calling pointer events on parent objects even when the "Send Pointer Hover To Parent" is off. [ISXB-586](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-586) - Improved performance of disconnected device activation (ISX-1450) +- Fixed DualSense controllers being recognized as DualShock4 (ISX-1411) ### Changed - Use `ProfilerMarker` instead of `Profiler.BeginSample` and `Profiler.EndSample` when appropriate to enable recording of profiling data.