Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

anjanesh

macrumors regular
Original poster
May 20, 2010
190
21
Navi Mumbai
I switched from my 2018 Intel MacBook Pro Mojave to 2022 M2 MacBook Air Sonoma and disconnected my 2018 Magic Keyboard and Magic Mouse and Magic Trackpad from the former to the latter.

But my Home and End keys are acting as Page Up and Page Down respectively. How / Where do I fix these ?
 

anjanesh

macrumors regular
Original poster
May 20, 2010
190
21
Navi Mumbai
I got it working from this blog post.

sudo bash
mkdir
-p ~/Library/KeyBindings ; cd ~/Library/KeyBindings
vim DefaultKeyBinding.dict

{
/*
Remap Home / End keys */
/*
Home Button*/
"\UF729" = "moveToBeginningOfLine:";
/* End Button */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home Button */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End Button */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
/* Ctrl + Home Button */
"^\UF729" = "moveToBeginningOfDocument:";
/* Ctrl + End Button */
"^\UF72B" = "moveToEndOfDocument:";
/* Shift + Ctrl + Home Button */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* Shift + Ctrl + End Button*/
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:";
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.