Skip to content

Commit 7cb59ce

Browse files
committed
Add proposed fix by PR #2245
1 parent abae6b3 commit 7cb59ce

File tree

1 file changed

+3
-2
lines changed
  • Packages/com.unity.inputsystem/InputSystem/Plugins/HID

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ internal static unsafe HIDDeviceDescriptor ReadHIDDeviceDescriptor(ref InputDevi
257257

258258
// Update the descriptor on the device with the information we got.
259259
deviceDescription.capabilities = hidDeviceDescriptor.ToJson();
260+
Debug.Log($"Parsing HID descriptor from JSON for device '{deviceDescription.capabilities}'");
260261
}
261262
else
262263
{
@@ -385,7 +386,7 @@ public InputControlLayout Build()
385386
var yElementParameters = yElement.DetermineParameters();
386387

387388
builder.AddControl(stickName + "/x")
388-
.WithFormat(xElement.isSigned ? InputStateBlock.FormatSBit : InputStateBlock.FormatBit)
389+
.WithFormat(xElement.DetermineFormat())
389390
.WithByteOffset((uint)(xElement.reportOffsetInBits / 8 - byteOffset))
390391
.WithBitOffset((uint)(xElement.reportOffsetInBits % 8))
391392
.WithSizeInBits((uint)xElement.reportSizeInBits)
@@ -394,7 +395,7 @@ public InputControlLayout Build()
394395
.WithProcessors(xElement.DetermineProcessors());
395396

396397
builder.AddControl(stickName + "/y")
397-
.WithFormat(yElement.isSigned ? InputStateBlock.FormatSBit : InputStateBlock.FormatBit)
398+
.WithFormat(yElement.DetermineFormat())
398399
.WithByteOffset((uint)(yElement.reportOffsetInBits / 8 - byteOffset))
399400
.WithBitOffset((uint)(yElement.reportOffsetInBits % 8))
400401
.WithSizeInBits((uint)yElement.reportSizeInBits)

0 commit comments

Comments
 (0)