Skip to content

Commit 3903f7d

Browse files
Usages renaming commit
1 parent d14924b commit 3903f7d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayout.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ private struct LayoutJson
16141614
public string format;
16151615
public string beforeRender; // Can't be simple bool as otherwise we can't tell whether it was set or not.
16161616
public string runInBackground;
1617-
public string[] commonUsages;
1617+
public string[] usages;
16181618
public string displayName;
16191619
public string description;
16201620
public string type; // This is mostly for when we turn arbitrary InputControlLayouts into JSON; less for layouts *coming* from JSON.

Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDebuggerWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ private TreeViewItem AddControlLayoutItem(InputControlLayout layout, TreeViewIte
778778
var value = layout.m_UpdateBeforeRender.Value ? "Update" : "Disabled";
779779
AddChild(item, "Before Render: " + value, ref id);
780780
}
781-
if (layout.commonUsages.Count > 0)
781+
if (layout.usages.Count > 0)
782782
{
783783
AddChild(item,
784784
"Usages: " +

Packages/com.unity.inputsystem/InputSystem/Plugins/HID/HID.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public InputControlLayout Build()
377377
.WithBitOffset((uint)bitOffset)
378378
.WithByteOffset((uint)byteOffset)
379379
.WithSizeInBits((uint)sizeInBits)
380-
.WithUsages(CommonUsages.Primary2DMotion);
380+
.WithUsages(Usages.Primary2DMotion);
381381

382382
var xElementParameters = xElement.DetermineParameters();
383383
var yElementParameters = yElement.DetermineParameters();
@@ -706,11 +706,11 @@ internal FourCC DetermineFormat()
706706
internal InternedString[] DetermineUsages()
707707
{
708708
if (usagePage == UsagePage.Button && usage == 1)
709-
return new[] {CommonUsages.PrimaryTrigger, CommonUsages.PrimaryAction};
709+
return new[] {Usages.PrimaryTrigger, Usages.PrimaryAction};
710710
if (usagePage == UsagePage.Button && usage == 2)
711-
return new[] {CommonUsages.SecondaryTrigger, CommonUsages.SecondaryAction};
711+
return new[] {Usages.SecondaryTrigger, Usages.SecondaryAction};
712712
if (usagePage == UsagePage.GenericDesktop && usage == (int)GenericDesktop.Rz)
713-
return new[] { CommonUsages.Twist };
713+
return new[] { Usages.Twist };
714714
////TODO: assign hatswitch usage to first and only to first hatswitch element
715715
return null;
716716
}

Packages/com.unity.inputsystem/InputSystem/Plugins/Linux/SDLDeviceBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private static void BuildStickFeature(ref InputControlLayout.Builder builder, SD
8686
.WithLayout("Stick")
8787
.WithByteOffset((uint)byteOffset)
8888
.WithSizeInBits((uint)xFeature.featureSize * 8 + (uint)yFeature.featureSize * 8)
89-
.WithUsages(CommonUsages.Primary2DMotion);
89+
.WithUsages(Usages.Primary2DMotion);
9090

9191
builder.AddControl(stickName + "/x")
9292
.WithFormat(InputStateBlock.FormatInt)
@@ -148,7 +148,7 @@ private static void BuildHatFeature(ref InputControlLayout.Builder builder, SDLF
148148
.WithLayout("Dpad")
149149
.WithByteOffset((uint)xFeature.offset)
150150
.WithSizeInBits((uint)xFeature.featureSize * 8 + (uint)yFeature.featureSize * 8)
151-
.WithUsages(CommonUsages.Hatswitch);
151+
.WithUsages(Usages.Hatswitch);
152152

153153
builder.AddControl(hatName + "/up")
154154
.WithFormat(InputStateBlock.FormatInt)

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ public class XRController : TrackedDevice
9898
/// var controller = XRController.leftHand;
9999
/// InputSystem.SetUsage(controller, CommonUsages.RightHand);
100100
/// </remarks>
101-
public static XRController leftHand => InputSystem.GetDevice<XRController>(CommonUsages.LeftHand);
101+
public static XRController leftHand => InputSystem.GetDevice<XRController>(Usages.LeftHand);
102102

103103
/// <summary>
104104
/// A quick accessor for the currently active right handed device. This is also tracked via usages on the device.
105105
/// </summary>
106106
/// <remarks>If there is no left hand connected, this will be null. This also matches any currently tracked device that contains the 'RightHand' device usage.</remarks>
107-
public static XRController rightHand => InputSystem.GetDevice<XRController>(CommonUsages.RightHand);
107+
public static XRController rightHand => InputSystem.GetDevice<XRController>(Usages.RightHand);
108108

109109
/// <summary>
110110
/// Override for FinishSetup().

0 commit comments

Comments
 (0)