PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
173 stars 52 forks source link

SceneView does not receive input (since at least Unity 2020.3.15f) #36

Open krisrok opened 3 years ago

krisrok commented 3 years ago

GameView needs to have focus for inputs being processed by InputSystem.

We have this behaviour on three separate Windows machines with two wireless (Universal Receiver, VID: 0x256f, PID: 0xc652) and one wired spacenavigator (SpaceMouse Compact, VID: 0x256f, PID: 0xc635).

After focus goes to Sceneview the InputSystem processes exactly one state event, then nothing. When refocussing GameView, the cumulated state events get processed in one batch. Or at least they get displayed in the InputDebug view.

Unity 2020.3.15f InputSystem 1.0.2

krisrok commented 3 years ago

I imagine the problem is the canRunInBackground property of InputDevice is returning false which is the device's correct answer in the usual use-case. But in Unity we have a special case (like an app-inside-the-app) which is not catered for in the InputSystem as far as I can see.

Others have circumvented this issue by using a local copy of the InputSystem package with the canRunInBackground checks patched out.

krisrok commented 3 years ago

In an attempt to deliver reproducability I set up a project from scratch on 2020.3.8f and SceneView navigation works fine (sometimes there is a few seconds delay after Unity's startup which likely is due to a known InputSystem bug related to Windows' hibernation feature, ugh...)

Then I upgraded the project to 2020.3.15f and the problem described above happens immediately. Downgraded the same project to 2020.3.8f and it works again even though packages stay at their 2020.3.15f upgraded versions.

I do not have any other editor versions in between of .8f and .15f so it's hard to tell when the breaking change happened.

krisrok commented 3 years ago

Stays broken on .16f, too.

PatHightree commented 3 years ago

I'm seeing it too, I thought it had something to do with adding the 'Suspend on GameView Focus' setting, but no. Unity U2021.2.0b3 InputSystem 1.1.0-pre.5

PatHightree commented 3 years ago

AH, someone reported the issue on the Unity forums and fogbugz, investigation is already in progress :) https://forum.unity.com/threads/configuring-canruninbackground-for-a-custom-inputdevice.1012072/ https://fogbugz.unity3d.com/default.asp?1360170_vkkvm9posrgpqdke

krisrok commented 3 years ago

Such coincidence! ;) Yeah let‘s hope it will be addressed.

patrickdown commented 3 years ago

I am having this issue too. Is there a work around in the short term until Unity fixes?

krisrok commented 3 years ago

You can only downgrade your project to e.g. 2020.3.8f. I only know it worked on .8f and broke somewhere on the way to .15f -- maybe you can find the exact version if you're persistent. If so, please report it here or in the forums.