M BUZZ CRAZE NEWS
// news

Is there a way to move the current window to another desktop without using a mouse in OS X?

By Joseph Russell

In OS X as I'm aware to move the current window to the next desktop, I'd click down on the title bar of the window to have it in move mode, and then while keeping the mouse button down, press Ctrl+ or Ctrl+. If you don't have a laptop, this may require three hands. Alternatively you can go into spaces and drag a window from one desktop to another.

Is there an easier way to do this, with the keyboard only (and two hands max)?

2

20 Answers

As of 10.7 you can activate "mission control" and then drag-n-drop your window to whatever desktop group.

enter image description here

See: OS X Mountain Lion: Work in multiple spaces

5

I think the best you can do is hold the window title bar with the mouse, then press Ctrl-1 (or 2, 3, 4, whatever). This requires using the mouse, but it's a little more convenient than other methods.

5

If you install "BetterTouchTool", you can create a keyboard/mouse/gesture shortcut to either:

  1. move application window to the other monitor,
  2. maximize application window to the other monitor.

Works really well! Plus, "BetterTouchTool" has tons of other nifty features that you may find useful. It's free.

5

Unfortunately, as of 10.5.4 at least, there is no way to do this using a keyboard shortcut only.

You can however do it using just the mouse, which also requires just one hand, by dragging the window to the edge of the screen. You can set more options for this using the Warp or Secrets preference panes (both free).

1

The easiest way to do this is to enable the shortcuts in settings to switch to the desktop of your choice as seen below. Once you've enabled it you can move the window of your choice by holding your mouse button and executing your shortcut.

enter image description here

4

This is not a solution, but it explains why it's not easy to find apps that support moving windows between spaces.

According to the developer of the open source Rectangles App, a keyboard-based window organizer, "Apple doesn't provide public APIs for Spaces. If at some point they do, I'll be glad to to revisit this [feature request]."

Apps that do provide this feature use a private API of Apple's, which is not supported or documented by Apple. Amethyst is an open source app that supports the feature (mentioned in another answer). If you're curious, it seems the code that performs moves a window from one space to another is in Window.swift:

// A method of Window:
final class AXWindowID: Hashable, Codable { // ... func move(toSpace spaceID: CGSSpaceID) { let currentSpace = CGSGetActiveSpace(CGSMainConnectionID()) let ids = [cgID()] CGSRemoveWindowsFromSpaces(CGSMainConnectionID(), ids as CFArray, [currentSpace] as CFArray) CGSAddWindowsToSpaces(CGSMainConnectionID(), ids as CFArray, [spaceID] as CFArray) if UserConfiguration.shared.followWindowsThrownBetweenSpaces() { focus() } }
}

It seems like Amethyst () could switch application to any workspace.

There is a tool called Zooom that will allow you to grab any part of a window to move it using a hotkey, and also similarly resize windows, again with a hotkey. This is very nice when moving from a linux wm to OS X, however I'm still wondering if just basic switching as in the question is available without additional software purchases.

Optimal Layout, an app I developed, lets you use keyboard commands to move, resize and change the Space of groups of windows.

2

If you are using window manager not desktopg environment, you can do that by modifying keymap, function TakeToWorkspace or SendToWorkspace.

For example in fluxbox.

$vi ~/.fluxbox/keys
Super_L 1 :TakeToWorkspace 1
Super_L 2 :TakeToWorkspace 2
Super_L 3 :TakeToWorkspace 3
Super_L 4 :TakeToWorkspace 4
Super_L 5 :TakeToWorkspace 5
Super_L 6 :TakeToWorkspace 6
Super_L 7 :TakeToWorkspace 7

Will allow you to press "mac button" + workspace number and focused window will be taken to the right workspace.

1

The actual answer to this is:

UPDATE: Spectacle is no longer maintained. The website forwards users to Rectangle, see Jack's answer or .


I just tried Spectacle, great app and it's free.

This is what it can do with the selected group of windows.

You need to activate accessibility support.

System Preferences > Accessibility > Enable access for assisted devices

As per comments: The accessibility option in Mavericks is now in

System Preferences > Security and Privacy > Privacy > Accessibility

If you drag using the title bar and hold it against a border of the screen it should move after a few seconds (if there is a 'Space' for it to go to). Sure you have to use the mouse but there's no key commands involved.

2

So, trying all the bogus methods out there accidentally led me to the solution everyone's looking for:

Click and Hold the window you want to move. Hold the Ctrl button. Drag the window to the edge of the screen until it moves the window to a new desktop. Drop the window and release the Ctrl button. Boom. Done.

Alternately, you can use Mission Control to drag and drop apps onto the Desktop you want, but that's not the solution you're looking for. Move along.

4

A. Control-Up, then drag the window to the TOP of the screen. Those are desktops. A fair bit harder to realize than Linux desktops; but, it works. Apple is trying to show you what is already on each desktop. B. The F3 button also activates Mission Control. Note: Use Control-side arrows to switch desktops

1

I use Amethyst to accomplish this. It has some really nice customizable shortcuts for window management.

amethyst settings screenshot

Amethyst is by default a tiling window manager, however, I disable all tiling in amethyst settings and only use it for the window management keyboard shortcuts. Probably overkill, but it works.

So for macOS 10.14.6 click on the apple menu and go to System Preferences and go to Mission Control click on Hot Corners in the bottom left corner of the window put Mission Control in one of the corners. Take your mouse up to the corner you assigned it to and it will separate the open windows on your desktop out pick what you want on a new desktop and drag it up to the top menu bar. Done you can create as many new desktops as the OS will support. Or swipe up with three fingers on your laptop and drag the application you want on the second desktop up to the top menu bar.

1

The free window organization app Rectangle can do this with the keyboard shortcut cmd + ctrl + alt + <- or -> (arrow keys). It moves the currently focused window to the next or previous desktop.

You can also change the shortcut bindings in the app. Apart from solving this problem, it also does a bunch of other window management tasks well IMO. It even moves to adjacent desktops if you execute the "move to right half of screen" shortcut multiple times.

There's a paid version that also does this and other things but I haven't found the free Rectangle to be insufficient in any way.

2021 - Use Amethyst

This can be done using "Amethyst" a small tool to help window layouts ()

Installation

brew install --cask amethyst

Usage

Amethyst uses two modifier combinations.

Default ShortcutDescription
mod1option + shift
mod2ctrl + option + shift

Here's the specific commands to shift the window across left/right

Default ShortcutDescription
mod2 + leftThrow focused window to space left
mod2 + rightThrow focused window to space right

Hope this helps someone!

I do this all the time using HyperSwitch. No mouse or clicking involved - 100% keyboard-only. It doesn't appear to be a documented feature, but I use it every day, like this:

  1. activate the window switcher (I use Cmd+Tab)
  2. select the window I want to move
  3. while still holding Cmd key, tap the number of the target desktop

It may or may not be relevant that I also have keyboard shortcuts defined for switching desktops as Cmd+Desktop-number (e.g. Cmd+2 for Desktop #2)

Since all other answers seem to be fine using the mouse in some way. I'll give my tip as well. If you have an Magic Mouse you can double tap with two fingers to launch the mission control.

enter image description here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy