+5 votes

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?

in Engine by (57 points)

2 Answers

0 votes

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.
by (57 points)
edited by
+2 votes

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

by (18 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.