macOS Tip: How-To Get The Home And End Keys On A Windows Keyboard To Work
dev_neil_a
Posted on January 16, 2023
Introduction
Whilst macOS does allow the use of non-Macintosh layout keyboards to be used, some of the keys don't work as intended in some applications. For myself, the main two are the home and end keys. In some applications, such as VS Code, they work as expected (so to the beginning or end of a line) but in another applications, such as Apple's Pages they may not work.
To resolve this, the key bindings can be adjusted to make them respond as they would on Windows or Linux.
This article will provide a step-by-step guide on how to get them to work.
Solution
In Finder, press SHIFT+CMD+g to open up the Go to Folder prompt.
Type in
~/Library
and press enter.When the new Finder window appears, scroll down until you see a folder named
KeyBindings
. If the folder does not exist, create it.Open a text editor, such as VS Code.
Create a new file and save it into the KeyBindings folder with a file name of
DefaultKeyBinding.dict
.-
In the file, paste in the below:
{ /* Remap Home / End keys to be correct */ "\UF729" = "moveToBeginningOfLine:"; /* Home */ "\UF72B" = "moveToEndOfLine:"; /* End */ "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */ "$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */ "^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */ "^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */ "$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */ "$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */ }
Save the file and exit the text editor.
Reboot the Mac and log back in.
Open up the Pages application.
Create a new file, type some text and use the home and end keys. They should now work as they do on Windows or Linux.
Conclusion
I hope you found this useful. Thank you for reading and have a nice day.
Posted on January 16, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.