Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible to support InputDevice.canRunInBackground when Application.runInBackground = true? #8

Open
ghost opened this issue Dec 26, 2020 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Dec 26, 2020

The way I'm using Mini requires the Unity process to run in the background (without window focus). I'm noticing that no midi input is detected when this occurs.

I traced it to InputDevice canRunInBackground being false for MidiDevice. It isn't clear to me how a custom InputDevice should be setup for QueryCanRunInBackground with the InputSystem (was first trying to modify Mini's to support it).

I ended up making the Input system a local package and forcing it to always accept background input (line 2424 of InputManager.cs ) as a workaround, but this isn't ideal.

Although that works, it behaves like there are 2 separate states for background and focused. For example, a knob in the background state updates the value, and then if Unity regains focus, the value jumps to what it was when Unity last had focus, and then the reverse for going back to unfocused.

Curious if you have any insight into this, if it could be supported in Minis or if it is a shortcoming of the new InputSystem.

@ghost ghost changed the title possible to support canRunInBackground when Application.runInBackground set? possible to support canRunInBackground when Application.runInBackground = true? Dec 26, 2020
@ghost ghost changed the title possible to support canRunInBackground when Application.runInBackground = true? possible to support InputDevice.canRunInBackground when Application.runInBackground = true? Dec 26, 2020
@keijiro keijiro self-assigned this Dec 27, 2020
@keijiro keijiro added the question Further information is requested label Dec 27, 2020
@chetan51
Copy link

Setting "Background Behavior" to "Ignore Focus" worked for me: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/manual/Settings.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants