Ken & Mike on the MATLAB Desktop

August 4th, 2008

The Keys to Moving and Resizing Docked Windows

Have you ever been stuck using a computer without a working mouse or equivalent pointing device? It can be an interesting experience. It’s surprising how much you can do with just the keyboard. For example, on Windows, pressing Alt-Space invokes a menu in the upper left corner of the selected application. Among the choices on this menu are move and resize. If you select one of these you can then use the arrow keys to reposition or resize the application window.

Clearly when a mouse is available most will find dragging to be a preferable way to move or resize a window. Still it’s nice that this feature is available to accommodate those who have inherent difficulty using the mouse.

MATLAB offers a similar keyboard driven mechanism for moving and resizing docked windows. Under the Desktop menu you’ll find Move and Resize options that operate on the currently selected window (if your goal is to avoid using the mouse see Keeping your fingers on the keyboard for information on how to move the selection among docked windows using the keyboard then use the menu mnemonics Alt-d, v and Alt-d, z to initiate move or resize, respectively).

While the primary motivation for including the move and resize options is to accommodate those who have difficulty using the mouse, that doesn’t mean others can’t take advantage this feature. Moving a docked window by dragging can be challenging because there is a hidden, though hopefully intuitive, mapping between the mouse position and the finite set of alternative locations.

When you select the move option the selected window’s location is placed under control of the arrow keys. Each arrow key stroke moves an outline representing the window to a new potential resting location. For example the following screen shots show the outlining of potential locations of the Current Directory window resulting from successive presses of the right arrow key. The sequence of locations is:

  1. Tabbed with the Workspace
  2. To the right of the Workspace
  3. To the left of the Command Window
  4. Tabbed with the Command Window
  5. To the right of the Command Window
  6. To the right of everything
  7. Minimized along the right border
Current Directory Location 1 Current Directory Location 2 Current Directory Location 3
Current Directory Location 4 Current Directory Location 5 Current Directory Location 6
Current Directory Location 7

When the window reaches the location you want, press the Enter key to commit the move. If you decide not to move the window after all, just press the Escape key instead. This can be a very convenient way to explore possible locations without risk of getting your desktop layout into an undesired state.

While key controlled window movement offers some advantages over dragging, there aren’t any obvious advantages to key controlled resize. Still, if you really want to avoid the mouse, feel free.

I don’t recommend moving the mouse around after initiating a move or resize, as the window will follow the mouse as if you were dragging. This shouldn’t cause any problems but it can be a bit disconcerting because the mouse button isn’t down. If you want to move or resize a window using the mouse you might as well forgo the menu options and simply press the mouse button while over its title or border, respectively, and drag.

2 Responses to “The Keys to Moving and Resizing Docked Windows”

  1. Arnold Newton replied on :

    I cannot move any icons to the right side of the desktop.
    There is about 3 inches of vacant space on the right side
    of the desktop and nothing can be moved into that space.
    When I try a horizonal line about 1 1/2 inches with a
    1/8 inch vertical line on each end of the line appears.
    What can I do to correct. I have downloaded the current
    driver for the nvidia video card. My desktop just suddenly
    started doing this. Previously it had worked fine allowing
    me to move icons all the way to the right…..HELP

  2. Peter replied on :

    Arnold,

    I’m not sure what you mean when you say you can’t move any “icons”. I assume you are trying to move docked windows since that is the topic of the article you commented on. It sounds like your desktop layout might be corrupted. If you haven’t already done so, try setting the layout back to the default (from the menu bar choose Desktop->Desktop Layout->Default). If this doesn’t work try these steps:

    1. Issue the prefdir command at the MATLAB prompt and note the reported directory.
    2. Exit MATLAB
    3. Delete the file MATLABDesktop.xml from the preferences directory
    4. Restart MATLAB

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Ken & Mike work on the MATLAB Desktop team.
  • DP: Hi i have a problem with ezplot3, i want to plot more than i curve in the same graph but hold on command...
  • Ken: Hi Arsalan, Unfortunately there is no way to get the new Editor API in older versions of MATLAB. -Ken
  • Arsalan: Hi, I am very excited about the MATLAB API for editor because right now i am working on a project and i need...
  • Johannes: Since I started using matlab-emacs some days ago I never experienced Emacslink. But I experienced some...
  • Francisco J. Beron-Vera: Hi all, I have recently learned about ViEmu (http://www.vimemu.c om) which, for Vi/Vim...
  • OysterEngineer: When I first learned of the Publish feature in MatLab, I thought it might be useful to help to...
  • Ken: Hi Herve, I’m not quite sure what you mean by “stand-alone&# 8221; mode? -Ken
  • Herve: I wonder when the publish fonction will be supported in standalone mode.
  • Mike: Ravi, What you described should work as far I understand it. Please follow up with technical support. With a...
  • Mike: @Daniel, Thanks for that note.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.