During Play in editor (PIE), is there a shortcut to simulate ESC without stopping the game?

A lot of games use keyboard ‘ESC’ for pause menus, backing out of UI etc. Currently in the ShooterGame sample, you can only send an Escape to the game in Standalone mode. In Play In Editor (PIE) mode the editor responds to the keypress by stopping the game.

It would be great if we could simulate Escape presses in Play In Editor (PIE) mode, for example by pressing Shift+ESC or another key binding to avoid stopping the game session.

1 Like

Under Editor Settings->Keyboard settings under Play World, try override the Stop command.

2 Likes

Thanks for the quick reply! I just tried this but it still seems to use Escape as well as the new binding to stop the game. I’ve got source access so I’ll dig in and find out why it’s still using Escape. Cheers!

if you bound ESC in the input settings just bind another key to the same mapping and remove that key when you cook your content

I could use an answer to this too. Trying to test functionality related to Escape key handling and it’s not quite working in Standalone but there’s no way for me to debug it in “New Editor Window” mode like I’d normally do. Setting a new binding in Editor Settings → Keyboard → Play World doesn’t make a difference; Escape still closes.

Try pressing f8. While in play

1 Like

Wow, I’m really digging out an old question. But I found this solution:

In DefaultEngine.ini in the project you can add:

[/Script/Engine.PlayerInput]
-DebugExecBindings=(Key=Escape,Command="CloseEditorViewport")

This should unbind the Escape button from closing the game in the editor.

Awesome - that makes testing in-game pause menus a lot easier in the editor. Thanks a lot.

Does not work in UE 4.9.1.

Oh. It seems they changed a place. Now you have to put those lines into the DefaultInput.ini, not Engine.

I can’t beleive this took a year to be answered, but thank you for being our savior!

Bump. Can we get answer for this? The posted solution no longer works.

I just tested the solution below which works in 4.10.1. Add the following lines to the bottom of DefaultEngine.ini in your project’s Config folder, then restart the editor.

[/Script/Engine.PlayerInput]
-DebugExecBindings=(Key=Escape,Command="CloseEditorViewport")

Technically the previous answer was correct, the location is wrong:

  1. Open DefaultInput.ini
  2. At the top, locate the section: [/Script/Engine.PlayerInput]
  3. Add the following line under all the “+DebugExecBindings” (There should be around four):

-DebugExecBindings=(Key=Escape,Command=“CloseEditorViewport”)

*Notice that the other four bindings have a “+” sign, while this “-” unbinds the original Esc key setting

It took me a little while to get this right. The location is in the UE4 main directory, not your project folder.

Hi ,

Checking into this I’m not sure what location you’re referring to as the Defaultinput.ini in the UE4 Main Directory still only resides in template project folders. So, for instance, if you modify the DefaultInput.ini for the Vehicle Template (for UE 4.11), then every 4.11 project you start with that template will have that functionality. However, if you modify your project’s DefaultInput.ini it will override the inputs from the UE4 main directory.

On the other hand, if you do not modify the DefaultInput.ini in the Main Directory then you can choose to add this functionality on a project to project basis. (Location: [YourProject]>Config>DefaultInput.ini.

A couple of notes: You do not have to add the script in the specific location I mentioned before, you can simply add the script to the bottom. Also, DefaultInput.ini does not exist in the Shooter Game example’s project folder, so this may be adding to the confusion.

-Let me know if you do not find this to be the case and/or provide the location in the UE4 main directory you are referring to in your comment if different from this explanation.

Thanks,

.

Hi ,
Default input and Player input were in two different places. The main directory is where I found the Player input. That was the part that I found confusing. I hope this helps. :slight_smile:

In 4.12 I found the general bindings (Script/Engine.PlayerInput) in:

C:\Program Files (x86)\Epic Games\4.12\Engine\Config\BaseInput.ini

There I was able to comment out (put a “;” in front of line) the bindings that I didn’t want, in my case the F1-F5 keys.

This engine sometimes. Honestly.

Does this still work in 4.13? It’s not appearing to have any effect.

This works in UE4.13 but the location is different. Use the path above:

C:\Program Files (x86)\Epic Games\4.12\Engine\Config\BaseInput.ini

-and add the line here:

Save and Close; Don’t forget to restart the Launcher/Engine.