170

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

  • 4
    Yes, using [SizeUp](http://www.irradiatedsoftware.com/sizeup/) from Irradiated Software. [Move windows around on a Mac with keyboard shortcuts and SizeUp](http://www.geekguides.co.uk/296/move-windows-around-on-a-mac-with-keyboard-shortcuts-and-sizeup/) – jsejcksn Sep 04 '10 at 19:57
  • 8
    it is 2019 and there is still no mouseless solution for that basic task – sousben Jan 25 '19 at 08:48
  • If it's really just the `Ctrl`+`<-` and the `Ctrl`+`->` that is the source of grief, know that you can change the shortcut key for moving spaces. It's under System Preferences -> Keyboard -> Shortcuts -> Mission Control – Randall Oct 12 '22 at 16:07
  • @jsejcksn thank you for suggesting SizeUp, it is the only application I've found so far that actually has the option to switch a application between spaces using keyboard shortcuts only. It sucks that it's 2023 and Apple still hasn't opened up it's spaces API to third party developers, cause I like using the Rectangle app for all my other window sizing needs – Ghos3t Apr 03 '23 at 19:21

22 Answers22

69

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,480
  • 5
  • 23
  • 17
  • 11
    does not work on OSX 10.8.4 – AWrightIV Aug 01 '13 at 00:06
  • 15
    @AWrightIV: It works on OSX 10.7. I'm not sure about 10.8 but you might have to enable the Ctrl-1 and Ctrl-2 shortcut key for switching desktops first under System Pref > Keyboard. That could be a reason for it not working. – lightalchemist Nov 02 '13 at 09:14
  • Perfect, exactly what I was looking for – Kevin Hooke May 28 '16 at 02:30
  • 3
    on 2017 this still is a great alternative. Even when you need to use the mouse its a lot more convenient than the rest – mjsr Jun 28 '17 at 14:40
  • 7
    Mouseless... the question specifically requests a mouseless answer. – Lucio Mollinedo Nov 27 '19 at 16:53
  • 1
    This works under OS 12.7 (Monterey). You *do* need to have the System Preferences -> Keyboard -> Shortcuts for Mission Control turned on, with "Switch to Desktop" turned on for each space. I can't speak for the other comments, but that may be why it appeared to not work under other OSX releases. – Randall Oct 12 '22 at 16:02
  • This works on 12.6, but you have to enable "Switch to Desktop [#]" under System Preferences > Keyboard > Shortcuts > Mission Control. – Joe Mornin Oct 14 '22 at 02:38
  • @LucioMollinedo: this IS mouseless. Use the touchpad to place the cursor of the the titlebar. Hold it down with one finger. Then with the other hand, press Ctrl+1/2/3/4, or Ctrl+←/→. – Dan Dascalescu May 08 '23 at 16:55
  • @DanDascalescu "Use the touchpad to place the cursor of the the titlebar.". Replace 'touchpad' with 'mouse' in that sentence. See where we're going to? – Lucio Mollinedo May 08 '23 at 16:59
63

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
  • 24,736
  • 27
  • 129
  • 199
Jocke
  • 815
  • 6
  • 2
20

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
  • 24,736
  • 27
  • 129
  • 199
user1183950
  • 319
  • 2
  • 2
12

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
  • 221
  • 2
  • 4
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
  • 1
  • 4
9

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
  • 225
  • 2
  • 4
  • 22
    again... this is not a MOUSELESS solution – iconoclast Mar 13 '19 at 19:53
  • 2
    Mouseless... the question specifically requests a mouseless answer. – Lucio Mollinedo Nov 27 '19 at 16:50
  • 6
    This is close to mouseless. Very cool. I didn't know this one was possible. – AdamHurwitz Mar 25 '20 at 18:09
  • 1
    Thanks for this answer - it is still useful/helpful, given that there doesn't seem to be a pure mouseless answer, this just requires LESS mouse :D e.g. see how Jay Conrod's answer has 38 votes! – Darren Shewry Apr 27 '20 at 08:46
  • "close to mouseless" — You can't be "close" to mouseless, you're either mouseless or you're not. If I have to remove my hand from the keyboard it's not mouseless. – Stephen P Jul 21 '22 at 17:14
  • I am very big on not using the mouse if I can help it, and I find this a really quick and excellent way of going quickly to a Desktop, as well as moving app windows to nominated desktops. – bhu Boue vidya Aug 08 '22 at 00:40
  • This config should be enabled in order to this https://superuser.com/a/184765/294349 work. Tried with Ventura 13.3.1 – lucasvscn May 03 '23 at 14:01
6

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

user366376
  • 69
  • 1
  • 1
3

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

  • Wow, Optimal Layout looks awesome! One small criticism that I noticed immediately upon watching the demo video, though: you misspelled "focused": http://www.future-perfect.co.uk/grammartips/grammar-tip-focussed-focused.asp ... but I'm already in love with the app. Thanks for the tip. – iconoclast Jan 09 '13 at 21:42
  • Wasn't the feature of changing spaces removed at some point? You could also change the description on [Spacey](http://most-advantageous.com/spacey/)'s page. "only compatible with Mac OS X 10.6 Snow Leopard" could also be interpreted that it's not compatible with 10.5 and earlier. – Lri Jan 12 '13 at 10:12
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
  • 7
  • Not relevant to the question - the question is about moving to another desktop aka space, not another monitor aka display. – certainlyakey Apr 24 '23 at 21:10
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.stack.imgur.com/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.stack.imgur.com/fTYIa.png

https://i.stack.imgur.com/zaSpd.png

Tejas
  • 11
  • 2
  • I don't want to move a window to a different _monitor_, I want to move it to another _desktop_, as the question asks. For example, I want to move a window from Desktop #6 on monitor #2 to Desktop #8 _also_ on monitor #2 – Stephen P Jul 21 '22 at 17:17
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!

Ben Winding
  • 223
  • 2
  • 4
  • As of this comment this is broken for what looks to be M1 macbooks https://github.com/ianyh/Amethyst/issues/686#issuecomment-1048101556 – meh Nov 10 '22 at 16:15
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
  • 5
  • 17
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
  • 1
  • 8
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
  • 4
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
  • 262
  • 1
  • 12
0

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
  • 5,299
  • 7
  • 16
  • 35
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 16 '23 at 20:08
  • Avoid posting answers to old questions that already got well received answers unless you have something substantial and new to add. – Toto Jun 16 '23 at 20:09
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.

DenJansen
  • 33
  • 1
-1

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

Viktor Mellgren
  • 1,050
  • 8
  • 17