Skip to content

Commit 6f3f40c

Browse files
lewish-unityekcoh
andauthored
CHANGE: Make DualSenseHIDInputReport public so it can be used in child devices (#1945)
* Make Dualsense Input Report public * Add test for dualsense recognition * Retrieve Lightbar color * BUMP: Version 1.9.0 --------- Co-authored-by: Håkan Sidenvall <[email protected]>
1 parent 7d68965 commit 6f3f40c

File tree

12 files changed

+34
-12
lines changed

12 files changed

+34
-12
lines changed

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from Assets/Samples/InGameHints/InGameHintsActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/SimpleDemo/SimpleControls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from Assets/Samples/SimpleDemo/SimpleControls.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Tests/InputSystem/InputActionCodeGeneratorActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from Assets/Tests/InputSystem/InputActionCodeGeneratorActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Tests/InputSystem/Plugins/DualShockTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,25 @@ public void Devices_SupportsDualShockAsHID_WithJustPIDAndVID(int vendorId, int p
177177
Assert.That(device, Is.AssignableTo<DualShockGamepad>());
178178
}
179179

180+
[Test]
181+
[Category("Devices")]
182+
[TestCase(0x54C, 0xCE6)]
183+
[TestCase(0x54C, 0xDF2)] //Dualsense Edge
184+
public void Devices_SupportsDualsenseAsHID_WithJustPIDAndVID(int vendorId, int productId)
185+
{
186+
var device = InputSystem.AddDevice(new InputDeviceDescription
187+
{
188+
interfaceName = "HID",
189+
capabilities = new HID.HIDDeviceDescriptor
190+
{
191+
vendorId = vendorId,
192+
productId = productId,
193+
}.ToJson()
194+
});
195+
196+
Assert.That(device, Is.AssignableTo<DualSenseGamepadHID>());
197+
}
198+
180199
#if UNITY_WSA
181200
[Test]
182201
[Category("Devices")]

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ however, it has to be formatted properly to pass verification tests.
3333
set by `InputSystem.settings.maxEventsBytesPerUpdate`. This additional information is available in development builds
3434
only.
3535

36+
### Changed
37+
- Changed `DualSenseHIDInputReport` from internal to public visibility
38+
3639
## [1.8.2] - 2024-04-29
3740

3841
### Added

Packages/com.unity.inputsystem/InputSystem/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static partial class InputSystem
1616
// Keep this in sync with "Packages/com.unity.inputsystem/package.json".
1717
// NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include
1818
// "-preview" suffixes here.
19-
internal const string kAssemblyVersion = "1.8.3";
20-
internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.8";
19+
internal const string kAssemblyVersion = "1.9.0";
20+
internal const string kDocUrl = "https://docs.unity3d.com/Packages/com.unity.inputsystem@1.9";
2121
}
2222
}

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastKeyboard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from "Keyboard" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastMouse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from "Mouse" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Packages/com.unity.inputsystem/InputSystem/Devices/Precompiled/FastTouchscreen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputLayoutCodeGenerator
4-
// version 1.8.3
4+
// version 1.9.0
55
// from "Touchscreen" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Packages/com.unity.inputsystem/InputSystem/Plugins/DualShock/DualShockGamepadHID.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace UnityEngine.InputSystem.DualShock.LowLevel
1717
/// See ConvertInputReport for the exact conversion.
1818
/// </summary>
1919
[StructLayout(LayoutKind.Explicit, Size = 9 /* !!! Beware !!! If you plan to increase this, think about how you gonna fit 10 byte state events because we can only shrink events in IEventPreProcessor */)]
20-
internal struct DualSenseHIDInputReport : IInputStateTypeInfo
20+
public struct DualSenseHIDInputReport : IInputStateTypeInfo
2121
{
2222
public static FourCC Format = new FourCC('D', 'S', 'V', 'S'); // DualSense Virtual State
2323
public FourCC format => Format;
@@ -349,7 +349,7 @@ public class DualSenseGamepadHID : DualShockGamepad, IEventMerger, IEventPreProc
349349

350350
private float? m_LowFrequencyMotorSpeed;
351351
private float? m_HighFrequenceyMotorSpeed;
352-
private Color? m_LightBarColor;
352+
protected Color? m_LightBarColor;
353353
private byte outputSequenceId;
354354

355355
protected override void FinishSetup()

0 commit comments

Comments
 (0)