Switching to OS X, Obstacle 2: Switching between windows

Obstacle 1: Where the heck is that button?
Obstacle 2: Switching between windows
Obstacle 3: Home/End buttons (Unsolved)
Obstacle 4: Python and friends

In OS X, Cmd-Tab switches between applications, and not between windows as under Windows or most Linuxes. That’s OK, in fact, I think I like it (I’m note quite sure yet).

However, I of course also want to switch amongst the windows within an application, using the keyboard. And here is where it gets tricky. Because whoever decided on the keys for that did something immensly stupid. He (or possibly she) decided to use Cmd+`. Yes, the grave accent key. This is fantastically stupid, because that is not a control key, and hence it moves around. It also means that switching the other way around is Cmd+~. Tilde. Many non-US keyboards doesn’t even have these keys, and they sure aren’t placed in a handy way. With the Swedish keyboard I could use the rather unpractical Cmd+Shift+´ (which is up by the backspace key) one way but the Cmd+Alt+¨ (by the enter key) does not work to switch the other way. Not very handy. I would like Alt+Tab or something reasonable like that.

I tried various ways of fixing this. You can set up Keyboard Shortcuts in the System Preferences, but it can’t map combinations of control keys the tab key, so my preference of using Alt-Tab wouldn’t work, and it also can only map keys to menu commands, and there is no menu command for switching windows in most applications. So that failed for two reasons.

I downloaded Ukulele, which is a cool app, and fiddled round with it. But although you can remap control keys, you can’t map combinations of control keys, and you can only map them to other control keys. I’ve been looking for a keyboard remapper for Unix that can do what Ukulele can, because I want to create a more programmer friendly keyboard that till has Swedish characters, so I will probably use Ukelele anyway, but in this case it didn’t help.

I found a script to help change the idiotic Mac behavior of Home+End of moving to the start end end of the document, to normal sane behaviour of moving to the start and end of the line. That doesn’t help me at the moment as I don’t actually have Home+End keys, but I thought the same technique might work for remapping the window switching. But no, as you can see in this overview there simply is no command to switch windows. This technique only works for text editing stuff (and not always that either, but that is another topic).

Finally I then discovered Witch, a utility to set up window switching in a quite flexible way. Currently I retain the Mac style application switching on Cmd+Tab, and have Witch set up to switch the windows within an application with Alt+Tab. If you want to remap Cmd+Tab to switch between all windows, then haha, you can’t, OS X doesn’t allow that, unlesss, you use another tool, called PullTab,  which in turn requires a framework called APE to be installed. With this Cmd+Tab gets available for remapping by Witch as well.

Now, if you come from a Unix world you might expect all this to be open source and for free, but this is not Unix, it’s Apple. APE is free to use, but the SDK costs money, so if you want to make your own enhancements with APE it’ll cost you $100. Witch is shareware, but the registered price of €9.95 is well worth it, IMO. PullTab is free, though, so having sane application switching in OS X will cost you only ten euros. It’s well worth it, but wasn’t Mac supposed to be fantastically useable and have a well throught out UI, from the start?

On the other hand, all the companies and websites involved in this has such lovely names, like “Many Tricks”, “Raging Menace” and “Unsanity” that at least the community keeps you giggling through the troubles.

So, now the keyboard troubles are finally over, right? Wrong!

23 Responses

  1. [...] Switching to OS X, Obstacle 2: Switching between windows [...]

  2. [...] Switching to OS X, Obstacle 2: Switching between windows [...]

  3. You should straighten your explanations then: the shortcut to switch between the open windows of the frontmost application works even if the Windows menu does not have a corresponding item. E.g. try Cmd-` in Mail and Safari. Your only problem is that, indeed, you can’t set that shortcut to Alt-Tab.

  4. Luc, Cmd+` is not a shortcut defined in the system preferences. If it is your opinion that it is possible to define a shortcut to switching windows, can you tell me what to write as menu command when I define the shortcut?

  5. Just to be crystal clear, I have not added that shortcut. It has always been there in Preferences > Keyboard & Mouse > Keyboard Shortcuts. It reads “Move focus to next window in active application”. The shortcut itself must be as old as MacOS X and it became modifiable since Apple added customisability in that area, circa MacOS 10.4 if I remember correctly.

  6. Ah, if you double-click in just the right place, you can then change the key-combination. That wasn’t exactly obvious. I double-clicked on the whole row, expecting to get a dialog if it was modifiable.

  7. I quite like OSX’s idea of application vs. window swapping. I do agree with you that choosing the `/~ key is elegant on U.S. keyboards but breaks horribly in other layouts.

    That said, I personally find localized keyboards to be utter rubbish for programming. I haven’t been using the German keyboard layout for years because on a typical day I’ll use {}, [], etc. way more often than umlauts and other German-specific keys. That’s why I came up with my own keyboard layout based on the U.S. layout (http://www.z3lab.org/sections/blogs/philipp-weitershausen/2006_04_26_keyboard-layout-for). You could do the same and rewrite the Swedish one to place the `/~ key where OSX suggests it. Just a thought. Or just use the U.S. layout. It’s better anyway :)

  8. Ah, I missed your last comment that you can in fact customize the keyboard shortcut. That’s quite handy, too.

  9. [...] Regebro spent significant time looking into resolving this and recommends the following: Finally I then discovered Witch, a [...]

  10. I’ve come to realize a thing about how the keyboard mapping works. You set up a key to switch Windows, by default Cmd+`, and the same combination, with shift, will switch the other way. So switching backwards is NOT Cmd+~, which is claimed everywhere. No, it’s Cmd+Shift+`. Now, Shift+` is ~, but that is not relevant to OS X. That is a bit confusing.

    Anyway, having a key that moves around in different layouts and may not even exist in some layouts, and has no mnemonic value as a default key for the action it does, is still stupid.

  11. You should give Witch a try to supplement window switching along with OS X application switching.

  12. Maybe you should read the post before you comment? :-)

  13. I actually came to this page looking for how to switch between windows in the current application and just discovered Cmd+` and my first thought was actually that it’s very convenient, since it’s only one button away from Cmd+Tab, you can quickly switch to the application you want and then to the window that you want.

    I also just found a way to fix a crucial setting that annoyed me – the fact that tabbing around textboxes would skip over buttons (so you’d have to click a button instead of hitting enter on it.) You can fix this by changing the “Full Keyboard Access” to “All Controls” on the Keyboard Shortcuts page.

  14. And I wrote about a couple other obstacles I fixed with some free software:
    http://philfreo.com/blog/switch-to-macbook-pro-and-os-x/

  15. Cmd+` is one button away on an AMERICAN keyboard, yes. It doesn’t even exist on Swedish keyboards. It’s a moronic choice by Apple.

  16. Thanks for a great summary of this issue!

    I recenttly bought a Macbook thinking that I could switch to OS X for all my duties.

    But after a few weeks with the Mac this issue with bad keyboard support is rerally making me thinking about going back from OS X.

    I will try some of your ticks, but I also have another very frustrating issue with the Mac.

    I have a dual monitor setup and I am used to be able to maximize windows so that they occupy all of the screen. For soem reason that is not possible in OS X. Or at least I have not been able to find out how to maximize a window so that it uses the entire screen.

    Can anyone give me tips on how to do this?

    Cheers,
    Yooakim

  17. Maximizing Windows are not The Apple Way to do things. ;)

  18. I’ve been using Windows for 19 years now and I just can’t get used to app switching in the Mac. I’d love to be able to remap cmd-tab to cycle thru windows instead of apps.

  19. @Joakim: It’s never a good idea to use a Mac in a Windows-like way. If you want to switch, you have to make the switch, it’s a complete waste of time to fail in reproducing your beloved Windows on your Mac.

  20. That is true, but I’ve never understood why you can’t maximize windows on mac. It is very useful.

  21. You can maximize windows on the Mac, just mouse-click on the green dot in the upper left corner of a window. Are you looking for another kind of window maximization?

  22. Yeah, it does’t really maximize it. There is some important but subtle differences.

    For example, in Windows and Unix, a maximized window will have the close button in the top right corner. And I really mean top right, all the way. You don’t need to grab the mouse, find the pointer and then move it over the button and aim and click. Instead you just “throw” the mouse top right and click. Doesn’t matter where the mouse is, throwing it top right and it will end up on the top most right most pixel, and that will work as a button.

    This is similar to how Macs menu always is at the top of the screen. You can just “throw” the mouse pointer there, instead of aim it onto the menu.

    So I’m not saying Mac is worse in the regards as a whole. I’m just pointing out that the non-maximizing in OS X is actually a drawback, and not a feature.

    And also, the fact that the behaviour of that green button seems a bit inconsistent to me doesn’t help… ;-)

Leave a Reply