IDE AddIn – Putting focus in the Code Editor by using a keyboard shortcut

One of the most annoying things that happened when Borland Developer Studio first shipped was that when returning from a debugging session the Code Editor didn’t have focus.

This was rectified in Update 2 although reseting your running application (Ctrl+F2) still doesn’t reset focus back to the Code Editor.

I have always wished for a shortcut to set focus to the Code Editor (as much as I like the F12 and F11 dance) and because of the oversight with the initial BDS 2006 release I decided to do something about it. Using some code from my Bookmark Viewer Add In (its on CodeCentral for those interested – with source) I’ve created an IDE Add In that sets the focus to the Code Editor when I press Ctrl+ALT+E.

Source is included so you can modify the shortcut used if you want.

You can download this Add In with source from here. Please adhere to the license conditions.

If the Welcome Page is active then pressing the shortcut does nothing. A unit must be selected for the Units code editor to receive focus.


  1. Uli Gerhardt says:

    Thanks, JED. This will be very useful! One minor nitpick though: The shortcut doesn’t work out of the box on non-English IDEs because SHORT_CUT isn’t localized – i.e it would have to be ‘Strg+Alt+E’ for a German Delphi. Maybe you want to change the type of TActionArgs.ShortCut to TShortCut or something similar to remove this issue.

  2. JED says:

    Hi Uli,

    Thanks for your suggestion.


  3. Rob Kennedy says:

    You should mention this add-in in the comments for QC 11089.

  4. Albert Research says:

    thanks JED… you made my day… I was looking for long for one think to open me the door to be able to Maximize the Editor Window with a shortcut… and THIS is the code… Thank you very much…

  5. JED says:

    Hi Rob,

    I’ve added a comment to the QC report that has a link to the blog post.

    Hi Albert,

    Glad I could be of assistance.