Change shortcut for focusing command window and editor?

The keyboard shortcuts for focusing the command window and the editor are Ctrl+0 and Ctrl+Shift+0. I want to change them, however I cannot find them listed in the keyboard shortcuts options in preferences. Is it possible to change them, or are they intended to be unchangable?

Answers (2)

Unfortunately, you are not able to customize the keyboard shortcut for making the command window or editor the active tool.
More information about which keyboard shortcuts you cannot customize can be found at the following link: http://www.mathworks.com/help/matlab/matlab_env/keyboard-shortcuts.html#br7iqjj-1

6 Comments

Hi Jonathan, Is it still the case in 2020?
Hi Josh,
The keyboard shortcuts for focusing on the command window (ctrl+0) and editor (ctrl+shift+0) are still not configurable. Refer to Jonathan's link for information on which shortcuts are configurable.
An enhancement request has been made to add support for configuring ctrl+0 and ctrl+shift+0. I will update the enhancement to reflect your request.
-Mark
I would also like this to be configurable. These shortcuts are not ergonomic. They either require 2 hands or an awkward 1 hand position. That would be nice if it was the same command to toggle back and forth between editor and command window.
Ctrl + ` would be great!!
Thanks for consideration, Sean
Any updates on this VERY BASIC feature in the past few releases?
I think it's safe to say that MathWorks is not actively working on this feature.

Sign in to comment.

Customizable keys is surprisingly hard in a large piece of software like MATLAB (I'm a Simulink UI dev).
However, it is possible to configure keys to your liking using software like Autohotkey (on Windows OS). Here's a script (put this in the AHK file) that will also give the MATLAB window itself focus if it doesn't already have it:
; AutoHotkey Version: 1.x
#NoEnv
SendMode Input
; Control + Windows key + E/C to bring Editor/Command-window of MATLAB into focus
^#E::FocusMATLAB("Editor")
^#C::FocusMATLAB("CommandWindow")
FocusMATLAB(focusWhatArg)
{
SetTitleMatchMode RegEx
if WinExist("MATLAB")
{
if( !WinActive() )
{
; Make sure MATLAB window has focus
WinActivate
}
if( InStr(focusWhatArg,"Editor") )
{
Send {Ctrl Down}{Shift Down}{0}{Shift Up}{Ctrl Up}
}
else ; CommandWindow case
{
Send {Ctrl Down}{0}{Ctrl Up}
}
}
}
Cheat sheet for modifier keybinds in Autohotkey: WinKey=#, Alt=!, Control=^, Shift=+

Categories

Asked:

on 2 Sep 2016

Answered:

on 19 Mar 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!