How to return the focus to editor when the played scene is closed?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rogeriodec

Every time I press F5 to play a scene and I close it, the focus is not automatically returned to the editor.
So I have to manually click on the editor.
I’d like to get the cursor in the exact position it was in the editor before pressing F5.
How to do that?

:bust_in_silhouette: Reply From: rogeriodec

I did a workaround creating an Autohotkey script (for Windows):

  1. Download and install Autohotkey
  2. Download this image and save it on any folder in your disk
  3. Download this script save it on any folder in your disk
  4. Edit the downloaded script (Godot.ahk) and replace the string C:\Users\Rogerio\Desktop\AHK\AHK_Imagens\Godot\F3.png by the exact
    path where you downloaded the image F3.png
  5. Save the edited Godot.ahk
  6. Double click Godot.ahk. It will run Autohotkey and remain active on Windows TaskBar.
  7. Open Godot Test F5, F6 and after ESC.
  • F5 and F6 will close the game window and reopen it (good when testing the game);

  • ESC will close the game window. Additionally, if the focus was previously on the Editor (F3), this will return the focus to the exact point of the cursor was before playing the scene.

:bust_in_silhouette: Reply From: InfraLiable

This is what I’ve found. If you switch to 2D or 3D view and then back to script view it should be focus exactly where you where, so:

F5: to play
F8: to stop
F2 and then F3: to continue editing where you where

This works on macOS tto, where the relevant bindings are:

⌘B to play
⌘Tab ⌘. to switch back to the window and stop the game
Opt+1 Opt+3 to restore focus to the editor pane

jeffs | 2020-05-22 04:12