InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Initialize last update time to MinValue to account for negative times

Open cbrwn opened this issue 5 years ago • 1 comments

Rarely, devices' internal times can be negative (not sure the cause), so the initial value of m_lastUpdateTimeInternal being 0 results in no input detected from these devices.

Here I just initialize it to MinValue in the constructor which fixed it for me, but a better fix may exist.

Here's a screenshot of my mouse and keyboard events having negative times (which detected no input) next to my Xbox controller events with positive times, which detected input.

image

cbrwn avatar Mar 09 '20 01:03 cbrwn

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Jun 03 '21 08:06 unity-cla-assistant

Hi! We've tried to reproduce the issue with latest Unity versions, and while device event times becoming negative is expected when entering playmode, any new events after that should contain a positive event time in the debugger.

If the issue still persist please create a bug report instead and attach this PR.

jimon avatar Oct 31 '22 15:10 jimon