"Device is DISABLED" for mouse every time a game starts?

I’m using the new input system with Unity 2020.3.3f1 , and the mouse isn’t working.
When looking at the input debugger, then mouse screen, there is a message there:

“Device is DISABLED. Control value will not receive updates. To force-enable this device, you can right-click it in the input debugger and use ‘Enable Device’”.

While the force-enable works, the mouse will be disabled again when I restart the game.
How do i fix it? why is it even happening?

I have the same issue. No click action bindings are triggered (want to bind “Back” action on the right mouse click), but the InputSystemUIInputModule seems to work and UI gets clicks. “Enable device” doesn’t work for me. Removing the InputSystemUIInputModule didn’t help too.

I’m using Unity 2020.2.7f with Input System package 1.1.0-preview.3.
I don’t use PlayerInput component, I create my own IInputActionCollection instance, generated from the editor.
I’m sure the action is enabled, as the keyboard and gamepad bindings work fine.

Reported this to Unity via the “Report a bug” form.

I’ve found out why this happens.
I had “Simulate Touch Input From Mouse or Pen” enabled which suppressed mouse events. Turning it off fixed it for me. Check yours in the “Input Debug” window, “Options” button.

Didn’t help in my case, I’m afraid. Whenever I switch into playmode the mouse gets disabled again. But even when I pause playmode, enable the mouse device and unpause no input is detected or recorded.

Did anyone ever find a solution for this? Without mouse input, my game is broken. :frowning:

I see in your other post that you tried a lot of stuff and it didn’t work. I guess you’ll have to strap on and dive in with the debugger. :smile: If I were you, I’d put break point on all the places InputDevice.m_DeviceFlags changes. With some patience you should get to the culprit.

Thanks. Sounds like I borked this up somewhere. Not sure how to debug this with Playmaker though. Wish me luck. :stuck_out_tongue:

How would I do that?

Uhm… not sure what you’re asking and what is your background. So here it goes…

If you’re asking what to look for, it’s hard to say:

Looking at the InputDevice.enabled code it returns false when m_DeviceFlags has flags “DeviceFlags.DisabledInRuntime”, “DeviceFlags.DisabledInFrontend”, “DeviceFlags.DisabledWhileInBackground”, etc…

        public bool enabled
        {
            get
            {
                #if UNITY_EDITOR
                if (InputState.currentUpdateType == InputUpdateType.Editor && (m_DeviceFlags & DeviceFlags.DisabledWhileInBackground) != 0)
                    return true;
                #endif

                if ((m_DeviceFlags & (DeviceFlags.DisabledInFrontend | DeviceFlags.DisabledWhileInBackground)) != 0)
                    return false;

                return QueryEnabledStateFromRuntime();
            }
        }

So you need to find who is setting those, which indeed can be hard as this code is very deep.

If you’re asking how to do debugging in general:

How to debug with Visual Studio - https://www.youtube.com/watch?v=d0815qbx3BA (random tutorial on the internet).
What you need is the “Call Stack” panel at the bottom right.
So, in VS go to the “PackageCache\com.unity.inputsystem@1.2.0\InputSystem\Devices\InputDevice.cs” file and put a break point (F9) on every line the m_DeviceFlags is set.

Attach the debugger and run the game and keep resuming till you get who is setting it with disable flags. Check with the call stack to trace back the culprit.

If your break points don’t work and you don’t see the Unity.InputSystem project in Visual Studio like so:
7793070--984183--upload_2022-1-9_14-16-16.png

You need to enable generating of such projects in the preferences. Go to Edit/Preferences/External Tools and enable “Embedded packages”, “Local packages”, “Registry packages”, “Built-in packages” (one of those should be it).
7793070--984186--upload_2022-1-9_14-18-45.png

Restart Unity, make sure it rebuilds the projects (reimport some .cs file).

I can’t help you much more without actually having the project right in front of me. :frowning:

Wow, thank you for this very detailed response. I will definitely use that at a later point. I was able to fix the issue by deleting the existing Event System and creating a new Empty GameObject with Input System components, which automatically added a new Event System component. This seems to have fixed the missing mouse input (at least for now).
Thanks again for your help. It is much appreciated.

btw I resolved the issue by deleting the existing Event System and creating an empty GO and adding an Input System component to that. The Event System component was added automatically to the empty GO and everything was working fine afterwards.
Now for my new nemesis: Touch controls. :smile:

if you add simulator tab, the mouse is disabled by default (tested at 2021,2.18f1)…and yeah i dont read change list…its huuuge.

You can force Mouse to be enabled (for example while playing in Editor with the Simulator open) as follows:

if (!Mouse.current.enabled) {
InputSystem.EnableDevice(Mouse.current);
}

My friend, I’ve been looking far and wide but couldn’t find the issue and I was desperate. But finally I found your answer!!! Disabling " Simulate Touch Input From Mouse or Pen" did the trick, Thanks a lot!!!

Almost 2026 and this issue with the mouse being DISABLED when first starting a project…

No mouse input will work until either turning Simulate Touch Input From Mouse or Pen on and then off would get the Mouse input working,

or using

if (!Mouse.current.enabled) {
InputSystem.EnableDevice(Mouse.current);
}

or Enabling Mouse…

What in the hell is going at Unity, engine/editor just falling apart with broken stuff like this. 6000.3.1f1 and 6000.0.64 both lts versions, this issue is present with the new input system, why in heck is the mouse disabled?!?

I hadn’t noticed this until recently when trying on an asset that basically didn’t work at all without the above actions, in other projects I had not come across this problem as something obviously triggers this to work and you’d never know it was an issue, what that is exactly I don’t know.. but I do know adding a canvas/input box, input event system etc never worked until doing the above with a blank scene project.

frustrating new and old input engine system just a mess.

I’ve just found that the reason this Mouse Input is Disabled, this was a new unity version 6.3 (where it now uses the new Input system by default, if you have it on Both or Old this issue doesn’t happen) with a blank project and imported asset, however the Unity layout was carried over from previously where I had the Simulator tab opened next to the Game tab, even though the Simulator tab wasn’t active or even being used in this project, it still Disabled mouse input on the Unity editor loading, the other tricks like enabling Mouse or toggling simulate on off worked but the underlying issue is that damn Simulator tab which wasn’t even in view or what I’d consider active, this is the reason why Mouse input doesn’t work on play in game view

if (!Mouse.current.enabled) {
InputSystem.EnableDevice(Mouse.current);
}

Personally think if the Simulator tab isn’t even being actively looked at it shouldn’t Disable the Mouse but there you go.

Once again, my limited knowledge has affected me. I was on simulator tab because I was building for mobile so I get the UI correctly, but I did not know this disables mouse input. Thank you very much

yes everything to do with the new input system has made things once again an unnecessarily complicated mess

unity no where to be seen on picking up issues like this, it was not obvious what was going on and only by chance did I discover it