While Mac programs usually have very consistent user interfaces, and most programmers religiously adhere to Apple’s human interface guidelines, there is one persistent glitch that continues to annoy us: the behavior of the Home and End keys. On a Mac, these keys should always, always, always move the cursor to the beginning and end of the document respectively.
Let me quote here from Apple:
Pressing the Home key is equivalent to moving the scrollers all the way to the top and to the left. In a text document, for example, pressing Home scrolls to the beginning of the document; in a spreadsheet, it may scroll to the beginning of the spreadsheet or to the beginning of a row. These keys should also work in scrolling lists to display the top or bottom of the list.
End is the opposite of Home: It scrolls to the end of a document.
If the beginning or end of the document is already reached, pressing Home or End produces a system alert sound. Pressing the Home or End key has no effect on the location of the insertion point or selected data.
Many applications, however, including some otherwise consistent programs such as Microsoft Word for the Mac and Firefox get this wrong. Usually they move to the beginning and end of the line rather than the document. They may also move the insertion point.
Mac native programs like BBEdit and Safari usually get this right. Misbehaving applications usually derive from Windows code bases. On Windows the convention is different. On Windows the Home key is supposed to move the cursor to the beginning of the line and the end key is supposed to move the cursor to the end of the line. Control-Home moves the cursor to the beginning of the document and Control-End moves the cursor to the end of the document. That is fine for Windows applications but it is not fine for Mac applications, not even Mac applications ported from Windows. It confuses users and causes your application to feel un-Mac-like.
It’s not hard to get this right, and it’s a really simple thing to do. I suspect it’s so commonly done wrong just because it’s so small that most developers overlook it. You’d notice immediately if the close button on a window were a black X instead of a red lozenge, but who even thinks to check where the Home and End keys put the user? Nonetheless, it is significant, and it is worth fixing.
When writing a Mac app please remember:
- The Home key moves the view to the top of the document.
- The End key moves the view to the bottom of the document.
- Neither key moves the insertion point.
Mac users thank you for paying attention to this.