Description

Came from a UDN: [Link Removed]

 

Proposed fix is to change `FRawInputWindows::ParseInputData` to use this logic instead:

```
...

USHORT BitSize = ValueCapsBuffer[iValue].BitSize;
LONG SizeMask = (1 << BitSize) - 1;

int32 SignedValue = EachValue & SizeMask;

ULONG UMin = ValueCapsBuffer[iValue].LogicalMin & SizeMask;
ULONG UMax = ValueCapsBuffer[iValue].LogicalMax & SizeMask;
if (UMin > UMax)

{ const int32 SignMask = 1U << (BitSize - 1); SignedValue = (SignedValue ^ SignMask) - SignMask; }

DeviceEntry->AnalogData[iValue].Value = (float)SignedValue;

...
```

Steps to Reproduce

Some devices use both positive and negative values for the device, but the raw input code will clamp some values to be only positive. 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-193608 in the post.

1
Login to Vote

Backlogged
ComponentUE - Gameplay - Input
Affects Versions4.265.3
CreatedAug 22, 2023
UpdatedAug 23, 2023