Skip to content

Switching to OS X, Obstacle 3: Home/End buttons (Unsolved)

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

As mentioned, my keyboard troubles are not over yet. Now it’s the rather important issue of moving the cursor to the end or the beginning of the line. This is one of the absolutely most common movements for a developer, and doing it with a mouse is not even thinkable. On normal operating systems, those who has had a person with a brain design the key-bindings, you use Home and End to move to the beginning and end of the row respectively. And Shift+Home and Shift+End to do so while selecting the text. The MacBook doesn’t have Home and End buttons, so you would use Fn+Left arrow and Fn+Right arrow for this, but here we immediately run into a huge problem. They key bindings in Mac OS X has not been decided by somebody with a brain. Home and End absurdly has a tendency to move to the top and the bottom of the page, or sometimes the start and end of the edit buffer. Now, this wouldn’t matter so much if this was consistent, and if there was another key binding for the beginning and end of a line. But it isn’t consistent, and there is a whole host of key bindings for navigation, none which is universally accepted. Here is an overview of what different keybindings do in different applications. All applications I use quite a lot.

A bit of explanation: Green is when the key does what I want. That means in the case of Left arrow it moves to the start of the line, and the Right arrow, to the end of the line, and if you press shift it will also select. Yellow means it does something else that is, if not useful, then at least expected. White is if it does nothing, red means is does something unexpected, which is really super bad.

Application Fn+Arrows Ctl+Arrows Cmd+Arrows Ctl+A/E
Safari Note 1 OK OK OK
Firefox OK OK
Textedit Note 1 OK OK OK
Open Office OK Fail Fail Fail
Terminal (Note 2) Fail Fail Fail OK
iTerm (Note 2) OK Fail Fail OK
WingIDE OK OK OK OK (Note 3)

Note 1: Normal Mac behaviour, and quite common is for Home/End to move to the top and bottom of the document. Safari does this, and using Shift will even select text as well if you are in a text area. TextEdit will select if you have shift, but not otherwise move.
Note 2: Vi refused to do Home/End with any of the key combinations in both terminals.
Note 3: WingIDE doesn’t map Shift+Ctrl+A and Shift+Ctrl+E correctly by default, but this is easily configurable.

The most important thing we can deduce above, is that the key combination that works mostly, is the Ctrl+A and Ctrl+E combination. It also do not work in Open Office, which is the software I use the least of the above. But, it is also the key combination I like the least of the above. And most of the softwares do NOT have reprogrammable keys.

This is a big drawback and a big obstacle for me to switch to Mac OS X. Unless I somehow can fix this and get reasonably consistent key bindings, I think it’s back to Ubuntu for me. Because although this is the last of my key problems, it is in no way the last of the OS X Obstacles.

To be continued.


From → linux, mac, plone, python

  1. I think you’ll just have to think of the Home and End buttons on a Mac as different keys than what they are on a PC. That’s what I did when I first got started with Macs. As an Emacs user I’m pretty much used to Ctrl+A and Ctrl+E anyway and it works 98% of the time. For instance, all Cocoa apps support it. Apps that use their own toolkit often don’t, though. Mozilla-based apps didn’t support for it for a long time, for instance. Regarding OpenOffice, I consider it a bug. They may disagree with it, but I think all Mac apps should obey the same paradigms.

  2. Yeah, and that’s just the problem here, they don’t. I agree that OpenOffice clearly is buggy in this. Calc doesn’t have the same behaviour as the other apps, and the other apps are inconsistent when it comes to how selection is done for example.

    Worse is that terminal uses Cmd+Arrows to switch tabs. That means that the Start/End of line behavior that most Apple apps support with those buttons isn’t supported there, which is very annoying.

    As you mention, Ctrl+A/E works in most places, but I just don’t seem to be able to get my fingers to do that without thinking first. Why vi don’t want to support any of keys I don’t know, but that can probably be configured, although I try to avoid vi anyway.

  3. Colloquy is another application that doesn’t support either Fn+Arrows or Cmd+Arrows. Very annoying. Basically I need to stop and thing every time I need to go to the start or end of a line.

  4. FWIW (from a different perspective, different context) I have some screen shots of the effects of modifier keys:

    Lennart, thanks for the table! It could prove a very useful (unbiased) point of reference if shortcuts in OOo 3.1 for Mac OS X fail to please the masses.

    Defocusing from Mac: concerning OOo on all platforms, there’s dating back to 2002. OOo users should please read beyond the heat (an issue closure thereabouts was *accidental* and if you agree that this should gain attention, please cast your vote.

  5. FWIW (I’m not sure whether it will help with any of the applications tabled above): demonstrates a dialogue in which you can assign keyboard shortcuts to menu commands.

  6. There are generally no menu commands for navigation.

  7. I just filed a bug on this with NeoOffice, to get the Ctrl-A/Ctrl-E bindings added. If the past is any indication of the future, then it will probably be in by the next patch that Patrick releases.

  8. Chris Gaskins permalink

    You are so right about this…. I switched to the Mac back in 2001. This still drives me nuts because I hate Mac keyboards and I use PCs at work. There should be a way to make all of this controllable by a single setting in the operating system.

  9. Johann permalink

    You’re not alone!

  10. Since I bought my first Mac last year this has been driving me nuts. I use Windows as well and Home/End Page Up/Page Down are consistent throughout and work as expected. I have an external Mac keyboard (with numeric keypad which includes home/end and pageup/pagedown) and these keys are still unpredictable. This is insanity. Why should I have to use a modifier (ctrl+a, ctrl+e) to achieve one of the most common and simple tasks in word processing/code writing. It just doesn’t make sense.

  11. Add the following lines to ~/Library/KeyBindings/DefaultKeyBinding.dict
    and if the directory and file do not exist then create them

    /* Remap Home / End to be correct 🙂 */
    “\UF729” = “moveToBeginningOfLine:”; /* Home */
    “\UF72B” = “moveToEndOfLine:”; /* End */
    “$\UF729” = “moveToBeginningOfLineAndModifySelection:”; /* Shift + Home */
    “$\UF72B” = “moveToEndOfLineAndModifySelection:”; /* Shift + End */

    Enjoy your home and end keys..!

    • Interesting. I may or may not try it. After all, my Macbook is getting a bit slow now, and I have no intention of buying a new one. 🙂

  12. I too agree, I moved over from Debian to Mac OS X, and ended up installing Debian alongside OS X on the MacBook. I used Debian on it for the longest time. I am again trying the move back to Mac… The KeyBindings trick worked for me in most apps but “Terminal”. I fixed the issue in Terminal, by going into it’s Preferences, selecting Settings. Here it will list all your profiles. Choose your default profile and select the “Keyboard” tab. Now find both home and end keys, and change the action to sending a string and input the standard Ctrl-A/Ctrl-E for each one. All done, now all your terminal apps(including Bash) can use home/end like a normal POSIX system.

  13. I recently added basic support for the DefaultKeyBinding.dict file to Firefox 25, so you can now use that (such as the example Jacob posted above) to get the Home / End functionality you expect.

Trackbacks & Pingbacks

  1. Switching to OS X, Obstacle 2: Switching between windows « Lennart Regebro: Plone consulting
  2. Switching to OS X, Obstacle 1: Where the heck is that button? « Lennart Regebro: Plone consulting
  3. D17’s blog » Blog Archive » I got a Macbook!
  4. Switching to OS X, Obstacle 4: Python and friends | Lennart Regebro: Python, Plone, Web

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: