Skip to content

Commit 4176ff7

Browse files
committed
Merge branch 'develop' into stable
2 parents d98b5e0 + 2f6372f commit 4176ff7

26 files changed

+943
-23
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.4.2
4+
// version 1.4.3
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.4.2
4+
// version 1.4.3
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/Plugins/UserTests.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,23 @@ public void Users_CanUnpairDevicesAndRemoveUser()
581581
}));
582582
}
583583

584+
[Test]
585+
[Category("Users")]
586+
public void Users_CanUnpairDevice_WhenPairedToMultipleUsers()
587+
{
588+
var gamepad = InputSystem.AddDevice<Gamepad>();
589+
var keyboard = InputSystem.AddDevice<Keyboard>();
590+
591+
InputUser.PerformPairingWithDevice(gamepad);
592+
InputUser.PerformPairingWithDevice(keyboard);
593+
var user = InputUser.PerformPairingWithDevice(gamepad);
594+
595+
user.UnpairDevicesAndRemoveUser();
596+
597+
Assert.That(InputUser.all[0].pairedDevices, Is.EquivalentTo(new[] {gamepad}));
598+
Assert.That(InputUser.all[1].pairedDevices, Is.EquivalentTo(new[] {keyboard}));
599+
}
600+
584601
[Test]
585602
[Category("Users")]
586603
public void Users_CanQueryUnpairedDevices()

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
Due to package verification, the latest version below is the unpublished version and the date is meaningless.
99
however, it has to be formatted properly to pass verification tests.
1010

11+
## [1.4.3] - 2022-09-23
12+
13+
### Fixed
14+
- Added missing script and gizmo icon for `TrackedPoseDriver.cs` component ([case ISXB-262](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-262)).
15+
- Fix for mitigating symptoms reported in ([case UUM-10774](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-10774) effectively avoiding reenabling mouse, pen or touch devices in `InputSystemPlugin.OnDestroy()` if currently quitting the editor. The fix avoids editor crashing if closed when Simulator Window is open. Note that the actual issue needs a separate fix in Unity and this package fix is only to avoid running into the issue.
16+
- Fixed an issue where Input Action name would not display correctly in Inspector if serialized as `[SerializedProperty]` within a class not derived from `MonoBehavior` ([case ISXB-124](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-124).
17+
- Fix an issue where users could end up with the wrong device assignments when using the InputUser API directly and removing a user ([case ISXB-274](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-231)).
18+
- Fixed an issue where PlayerInput behavior description was not updated when changing action assset ([case ISXB-286](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-286)).
19+
20+
### Changed
21+
- Improved performance of HID descriptor parsing by moving json parsing to a simple custom predicitve parser instead of relying on Unity's json parsing. This should improve domain reload times when there are many HID devices connected to a machine.
22+
1123
## [1.4.2] - 2022-08-12
1224

1325
### Changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static partial class InputSystem
1515
// Keep this in sync with "Packages/com.unity.inputsystem/package.json".
1616
// NOTE: Unfortunately, System.Version doesn't use semantic versioning so we can't include
1717
// "-preview" suffixes here.
18-
internal const string kAssemblyVersion = "1.4.2";
18+
internal const string kAssemblyVersion = "1.4.3";
1919
internal const string kDocUrl = "https://docs.unity3d.com/Packages/[email protected]";
2020
}
2121
}

Packages/com.unity.inputsystem/InputSystem/Devices/InputDeviceMatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ private static bool MatchSingleProperty(object pattern, string value)
348348
{
349349
// String match.
350350
if (pattern is string str)
351-
return string.Compare(str, value, StringComparison.InvariantCultureIgnoreCase) == 0;
351+
return string.Compare(str, value, StringComparison.OrdinalIgnoreCase) == 0;
352352

353353
// Regex match.
354354
if (pattern is Regex regex)

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.4.2
4+
// version 1.4.3
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.4.2
4+
// version 1.4.3
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.4.2
4+
// version 1.4.3
55
// from "Touchscreen" layout
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Packages/com.unity.inputsystem/InputSystem/Editor/DeviceSimulator/InputSystemPlugin.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ internal class InputSystemPlugin : DeviceSimulatorPlugin
1212
internal Touchscreen SimulatorTouchscreen;
1313

1414
private bool m_InputSystemEnabled;
15+
private bool m_Quitting;
1516
private List<InputDevice> m_DisabledDevices;
1617

1718
public override string title => "Input System";
@@ -21,6 +22,9 @@ public override void OnCreate()
2122
m_InputSystemEnabled = EditorPlayerSettingHelpers.newSystemBackendsEnabled;
2223
if (m_InputSystemEnabled)
2324
{
25+
// Monitor whether the editor is quitting to avoid risking unsafe EnableDevice while quitting
26+
UnityEditor.EditorApplication.quitting += OnQuitting;
27+
2428
m_DisabledDevices = new List<InputDevice>();
2529

2630
// deviceSimulator is never null when the plugin is instantiated by a simulator window, but it can be null during unit tests
@@ -95,15 +99,27 @@ public override void OnDestroy()
9599
deviceSimulator.touchScreenInput -= OnTouchEvent;
96100
InputSystem.onDeviceChange -= OnDeviceChange;
97101

102+
UnityEditor.EditorApplication.quitting -= OnQuitting;
103+
98104
if (SimulatorTouchscreen != null)
99105
InputSystem.RemoveDevice(SimulatorTouchscreen);
100106
foreach (var device in m_DisabledDevices)
101107
{
102-
if (device.added)
108+
// Note that m_Quitting is used here to mitigate the problem reported in issue tracker:
109+
// https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-10774.
110+
// Enabling a device will call into IOCTL of backend which will (may) be destroyed prior
111+
// to this callback on Unity version <= 2022.2. This is not a fix for the actual problem
112+
// of shutdown order but a package fix to mitigate this problem.
113+
if (device.added && !m_Quitting)
103114
InputSystem.EnableDevice(device);
104115
}
105116
}
106117
}
118+
119+
private void OnQuitting()
120+
{
121+
m_Quitting = true;
122+
}
107123
}
108124
}
109125

0 commit comments

Comments
 (0)