190

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)?

26 Answers26

77

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.

Jay Conrod
  • 5,806
70

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

kenorb
  • 26,615
Jocke
  • 909
21

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.

kenorb
  • 26,615
16

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()
    }
}

}

gonzojive
  • 258
13

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

Jonathan
  • 273
10

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).

dF.
  • 271
7

It seems like Amethyst (https://github.com/ianyh/Amethyst) could switch application to any workspace.

3

I know this is an old question - but Raycast with the Window Management is what I use now.

  • Next Display
  • Previous Display

I use Hyperkey to trigger this, but it's not necessary.

a screenshot of the Raycast window management extension

Simon
  • 151
3

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

2

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.

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.

douira
  • 131
1

The actual answer to this is:
https://apple.stackexchange.com/questions/28569/is-there-a-keyboard-shortcut-to-move-a-window-from-one-monitor-to-another/82015#82015

UPDATE: Spectacle is no longer maintained. The website forwards users to Rectangle, see Jack's answer or https://github.com/rxhanson/Rectangle/releases.


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

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

https://i.sstatic.net/3F9yj.png

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

https://i.sstatic.net/fTYIa.png https://i.sstatic.net/zaSpd.png

Markus Meyer
  • 1,910
Tejas
  • 11
  • 2
1

2021 - Use Amethyst

This can be done using "Amethyst" a small tool to help window layouts (https://github.com/ianyh/Amethyst)

Installation

brew install --cask amethyst

Usage

Amethyst uses two modifier combinations.

Default Shortcut Description
mod1 option + shift
mod2 ctrl + option + shift

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

Default Shortcut Description
mod2 + left Throw focused window to space left
mod2 + right Throw focused window to space right

Hope this helps someone!

1

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.

ingh.am
  • 224
1

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.

okobaka
  • 335
0

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

0

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.

0

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.

0

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)

pedorro
  • 103
0

If you really want a built-in, mouse-less solution ...

... you're probably not going to like it ... but, you can use Mouse Keys. This lets you move the pointer with the keyboard.

  • Go into System Preferences -> Accessibility -> Pointer Control -> Alternate Control Methods

  • Click "Options ..."

  • For quickest pointer movement, set Initial Delay to "short" and Maximum Speed to "fast" (otherwise, it really will be faster to just use the mouse if you can)

  • Set a way to toggle Mouse Keys usage

    • Check the "Press the Option key five times to toggle Mouse Keys"
    • And/or, if you don't need any other Accessibility features:
      • Scroll down from "Pointer Control" to "Shortcut"
      • Uncheck all boxes except Mouse Keys
      • Exit Accessibility, go to Keyboard -> Shortcuts -> Accessiblity
      • Make sure "Show Accessibility controls" is turned on (checked) and set a custom keystroke if desired
  • Turn on Mouse Keys and use when desired; when Mouse Keys is on, keyboard letters only control the pointer. Per macOS User Guide:

    Move the mouse pointer:
    With a numeric keypad: Use the 7, 8, 9, 4, 6, 1, 2, 3 keys on the keypad. (8 is up, 2 is down, etc) With the keyboard: Use the 7, 8, 9, U, O, J, K, L keys. (8 is up, K is down, etc)

    Click a mouse button:
    With a numeric keypad: Press 5 on the keypad.
    With the keyboard: Press I.

    Press and hold the mouse button:
    With a numeric keypad: Press 0 (zero) on the keypad.
    With the keyboard: Press M.

    Release the mouse button:
    With a numeric keypad: Press “.” (period) on the keypad.
    With the keyboard: Press “.” (period).


So, you can use any of the other methods here that "require" a mouse - even the one in your own original post - by way of the Mouse Keys:

  1. Turn on Mouse Keys
  2. Press the keys to move the pointer to the title bar
  3. Press M (or 0 on a numeric keypad) to "press and hold" the pointer
  4. Press Ctrl+ / Ctrl+
    or
    Ctrl+1 / Ctrl+2 / etc
  5. Press . to "release" the pointer
  6. Turn off Mouse Keys

Is that more convenient than using the mouse and the keyboard? Well, I guess YMMV.

Randall
  • 306
0

This is how I managed to do this on Sonoma 14.5. First, you need to set a specific shortcut for all applications manually as I explain below:

Go to "System Settings -> Keyboard -> Keyboard Shortcuts -> App Shortcuts". Expand "All applications" and add the new shortcuts based on your menu item title. In my case as presented in the picture below, it should be "Window->Move To BenQ PD2705U".

Sample configured shortcuts

If you don't know what is the name of your menu item, just try any Window menu option of any app on any monitor to see it. (Remember the menu item shows the name of the other monitor, not the one that the app is already open on)

Sample menu item

You should define one shortcut for each monitor you have.

Now just make sure the app you want to move between monitors is selected (focused on) using CMD+TAB and when you hit the configured shortcut on the keyboard, the selected app/window moves.

Now, using this, we are moving apps between monitors. But what if you have more than one desktop on one of the monitors? Unfortunately, I couldn't find a solution for this one. I have to click on the other monitor first to be able to CTRL+-> or CTRL+<- to iterate between desktops and then move the application to the desired desktop.

Markus Meyer
  • 1,910
MjCo
  • 1
0

Hold the window's title bar, and drag it to the edge of the screen. Wait a sec, and it will move the the next desktop.

https://support.apple.com/en-gb/guide/mac-help/mh14112/mac

mousomer
  • 101
0

I have an external screen, so I am able to do this in a roundabout way - using Rectangle app.

With Rectangle, using (ctrl + opt + right/left arrow) successively moves a window to another screen (after first moving it to right/left half, and then to the next screen).

So I use above, then change the desktop on my main screen (ctrl + right/left arrow) to where I wanted to move the window, and then switch back to the window I moved earlier, and move it back to the main screen (again using ctrl + opt + right/left arrow).

phuclv
  • 30,396
  • 15
  • 136
  • 260
0

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.

-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

-2

Sometimes we need to see the problem from a new angle. MacOS has one of the best window management systems, if not the best. It's different from Windows and requires a change of mindset. The cursor has been essential to MacOS since its inception, and using a Mac without it is like driving a car without a steering wheel.

If you want to move a window to another workspace, just drag it with the cursor to the corner of the screen in the direction of the desired space. (This only works with one monitor).

Another option is to use Mission Control. If you want a window to accompany you in all your workspaces, you can “Assign To” all of them, so it will always be present wherever you are. Press Control + Left mouse button on the application icon on the Dock and choose Options -> All Desktops.

Destroy666
  • 12,350