Ctrl+Backspace is hardcoded to open the DebugManager

Edit: I figured out how they opened this. See the next post.

I got a screenshot from a user today showing some weird stuff on the screen in a build of my game. I deduced that it was probably the Decal debug display that’s discussed in the HDRP debug visualization:

6542617--739768--upload_2020-11-20_2-17-14.png

The thing is, it’s not clear how the user got this to show up, or how to get rid of it, short of restarting the game. The docs state that you can open the whole debug console by pressing ctrl+backspace, but that doesn’t do anything for me.

In my HDRP asset, I have the debug console disabled, yet it still seems to have shown up in a build. Is there a way to turn this off, so users aren’t accidentally opening this? This is under HDRP 7.5.

Digging into this a bit deeper, I figured out how the user managed to get that Decal debug display open. It seems that the keystroke required to open the DebugManager is to hold Backspace, then press Left Control while Backspace is currently held down. Then, if you hit Enter, it will toggle the decal display.

What I can’t figure out yet is how to prevent this. I figured out the issue by examining the source code:

Line 62 has this behavior hard-coded: enableDebugMenu.keyTriggerList.Add(new[ ] { KeyCode.LeftControl, KeyCode.Backspace });

Short of creating a local package for com.unity.render-pipelines.core, and manually editing this, I don’t see a way to turn off this behavior in my game. Is it really the case that every HDRP game will show a debug window if a user happens to have Ctrl and Backspace pressed at the same time? Or am I missing a really simple way to turn this off?

I’m still looking for a way of disabling this Debug feature in my builds. I have a feedback form in my game where people can just type whatever they want. It turns out that hitting Ctrl+Backspace (the hard-coded key binding to launch this debug display) happens quite a lot, and is very confusing to players.

At some point I’ll just give up on this and make a local copy of the package, but there really should be some other way to prevent Ctrl+Backspace from opening this menu.

Is this still hardcoded? I was testing an in-game chat box today. Pressing ctrl+backspace would bring up this debug view when I just wanted to delete a word.

Okay so if you use the new Input System, you can disable the action map via reflection:

var fieldInfo = typeof(UnityEngine.Rendering.DebugManager).GetField("debugActionMap",
    BindingFlags.NonPublic | BindingFlags.Instance);
var debugActionMap = (InputActionMap)fieldInfo.GetValue(UnityEngine.Rendering.DebugManager.instance);
debugActionMap.Disable();
1 Like

Hello! Does this menu pop on non-dev builds for you or are you looking for an out of the box option to disable this on development builds?

There is a better way to disable runtime debug UI introduced in this PR. You can simply use DebugManager.instance.enableRuntimeUI = false;. However if it was appearing in non-dev builds please let me know

EDIT Just noticed, unfortunately this API change exists only in SRP master for now, but it should reach the next public version.

1 Like

Yes, an out-of-the-box way to configure this would be much appreciated. May be enough to just make debugActionMap publicly accessible.

1 Like