Skip to content

Switching to OS X, Obstacle 2: Switching between windows

November 7, 2008

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!

About these ads

From → linux, mac

33 Comments
  1. Luc Bourhis permalink

    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.

  2. 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?

  3. Luc Bourhis permalink

    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.

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

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

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

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

  8. Tait permalink

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

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

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

  10. 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/

  11. Joakim Westin permalink

    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

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

  13. mds permalink

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

  14. mds permalink

    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?

  15. 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… ;-)

  16. Geoff permalink

    Why is it that I can bring to the front two windows belonging to different applications using the mouse, but when I use the keyboard I get every window of the selected application brought to the front? It can be quite comical trying to get a particular finder window next to a particular firefox window using only command-tab and command-`. There should have been a way to only switch to (and bring to the front) a single window of a particular application, not all at once!

    Great post, Thanks!

  17. raffael permalink

    Thanks for this post–good stuff!
    Mac has had the switching-through-windows-in-application feature for a long time. However, on my computer (using French keyboard), it has always been cmd+) the other way. That was on OS 10.1 through to 10.4.x… Maybe even on OS 9?? Not sure about the latter.
    Thanks to your post I understood it is cmd+` now. However, ` already uses shift on my keyboard (shift+^). So adding shift to go the other direction doesn’t work… :(
    And worse still: if the focus is in this text field and I try to switch, it will just type a ^ (why the heck does cmd+shift+^ give the same result as ^ alone???).
    And even worse: switching through my windows in Safari (version 5.0; on OSX 10.6.3) I get stuck on a window with a pdf-file open (in Safari). I have just tested it opening another pdf-file in another window. There also I get stuck.
    I have to say I am a bit pissed off with Apple choosing cmd+shift+`…
    I’ll try to remap as described by Luc and Lennart.
    merci!!

  18. raffael permalink

    …something weird happened to the special characters in the second line. The second line should read:
    … computer (using French keyboard), it has always been cmd+” (“larger than” sign) the other way. That was on OS 10.1 …

  19. andrei permalink

    i have bought a mac pro 2 days ago and i have managed to reassign the switch between windows shortcut to ALT+TAB without issues…

  20. Jon permalink

    How about when Cmd+` works for every app but Mail??? That’s what’s been happening to me lately. Very frustrating since I’m totally used to switching windows in any app with Cmd+` but somehow this feature gets stuck in Mail.
    After a restart of Mail it works for a few switches and then it stops, whereas in i.e. Safari I can keep switching like there’s no tomorrow..So it couldn’t be the keyboard. Same thing happens if I change the shortcut. Works in all apps but mail. Is there maybe a max total of windows Mail can handle being open?
    Anybody a suggestion? Thanks a bunch!

  21. Thomas permalink

    Nice article. I recently switched to Mac and found this still very useful. Witch is a very nice application.

    I found an application which solved the home end keys for me, in case you don’t know about it here is the link:

    http://www.cocoabits.com/KeyBindingsEditor/

  22. Lars Bjarby permalink

    I realize this is quite an old blog entry but I thought I’ll leave a comment here as I found your article while searching for a solution to the same problem. Switching between windows within an application in OSX Lion on a Swedish keyboard.

    I have never gotten the Option-` shortcut to work, but I noticed today in the “Windows”(/”Fönster”) menu in Finder there are actually a shortcut that is Option-< which switches between windows (at least when using a Swedish keyboard layout) in a single application. This shortcut is not present in the menu in Firefox for example, but it still works.

    I'm mainly leaving this comment here so I'll find it the next time I don't know how to do this, hope it helps someone :-)

  23. I have an American MacBook Pro and use a Norwegian keyboard layout. This means that the key ` (the one over Tab) actually gives you the character <, so changing windows in the applications isn't easy.

    Here are the keys I use to help, without installing anything:
    - The character ' is Option-\
    - The character @ is \
    - The character is ~

    To set up “Move focus to next window” so you can use a shortcut to change windows in an application, simply go to System Preferences -> Keyboard -> Keyboard & Text Input, and double click on the symbols Cmd-`, then click-and-hold the actual keys Cmd-` which gives you the characters Cmd->. Then press Enter.

    Et voila! No programs to install, now you actually have the same keyboard shortcut as Mac wants you too, but with your local keyboard layout.

Trackbacks & Pingbacks

  1. Switching to OS X, Obstacle 1: Where the heck is that button? « Lennart Regebro: Plone consulting
  2. Switching to OS X, Obstacle 3: Home/End buttons (Unsolved) « Lennart Regebro: Plone consulting
  3. Switching to Mac: General Annoyances « You’re a smart guy, figure it out!
  4. tools to make macos more usable « Five12’s Blog
  5. Switching to OS X, Obstacle 4: Python and friends | Lennart Regebro: Python, Plone, Web
  6. Cambiar entre ventanas |

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,338 other followers

%d bloggers like this: