I’m trying to receive input while the game is not focused. I can’t get mouse or keyboard input working while the app is not focused. I’m making a utility for vtubers, so operating while other apps is focused is key.
I’ve tested with 1.1.1, 1.1.0-pre.6, and 1.0.2. I’ve tried polling and callbacks.
var mpos = ((Vector2)Mouse.current.position.ReadValue());
public InputActionReference MouseAction;
...
MouseAction.action.performed += (x) =>
{
MousePos = x.ReadValue<Vector2>();
Debug.Log(MousePos);
};
When looking at the input debugger, new mouse states are generating but the mouse values are not updating (this may be an editor only behavior). The events are not called. On Start() the Mouse shows that it supports running in background.
I’ve tried setting the Background Behavior setting to both “Reset And Disable Non Background Devices” and “Ignore Focus.”
The application is set to run in background. I’ve debugged to ensure that it is updating.
I’ve attempted setting the Update mode to Dynamic Update and also manually calling Update.
All of this is true for the Keyboard and Mouse.
Editor is set to “All Device Input Always Goes To Your Game View.”
The problem persists in builds.
I’ve put a lot of time into getting Input System working with my tool, but it’s starting to feel like I might have to jump to Rewired. Any advice on what to attempt next or any potential fixes? It feels like this is a bug in the Input System package.
EDIT: Clarified some verbiage.