Daily Unreal Column #75 - DebugExecBindings
When working on game project, making debug tools is essential. The easiest way to enable them is by using console variables or cheat commands. Here is how to easily bind them to keys for ease of use.
If you are using some tools very often it might be a great convenience to have a dedicated key to activate it. However, we, of course, don’t want to waste actual player input binding for that, as we are not going to ship our game with debug tools. Luckily, Unreal Engine already has a concept of debug key bindings, for example, for toggling different view modes using function keys (F1, F2, …).
These bindings are defined inside a BaseInput.ini
file.
[/Script/Engine.PlayerInput]
; --- General bindings
+DebugExecBindings=(Key=F11,Command="LevelEditor.ToggleImmersive", bIgnoreCtrl=True, bIgnoreAlt=True)
+DebugExecBindings=(Key=F11,Command="MainFrame.ToggleFullscreen",Shift=True)
+DebugExecBindings=(Key=F1,Command="viewmode wireframe", bIgnoreShift=True)
+DebugExecBindings=(Key=F2,Command="viewmode unlit")
+DebugExecBindings=(Key=F3,Command="viewmode lit")
...
So, to add your own keys, you can either modify this config file directly, or add the [/Script/Engine.PlayerInput]
section in one of your game specific configs to enable them.
The key bindings will be automatically stripped out in a shipping build.