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

fester225

macrumors newbie
Original poster
Dec 30, 2020
7
1
Having spent the last 20 years running (Ubuntu) Linux, it has been decided I'm going to learn how to use Mac mini (Big Sur).
One thing I'm really missing is the Windoze-style END and HOME keys. Yes, I know there are two-key substitutes. I'd rather use one key to perform these functions. I followed the directions for /Library/KeyBindings/DefaultKeyBinding.dict, but it doesn't seem to work on the Mini.

Are there any new work-arounds to make END and HOME work Windoze-style on the Mini yet?
 
  • Like
Reactions: Marty_Macfly
Hi @fester225 Just came across your issue with END/HOME keys on macOS.

I'm on M1 Mini and got this to work by following this tutorial. This other site has more key bindings which I haven't tried yet. You might also want to try that one as well.
 
  • Like
Reactions: Marty_Macfly
Hi @fester225 Just came across your issue with END/HOME keys on macOS.

I'm on M1 Mini and got this to work by following this tutorial. This other site has more key bindings which I haven't tried yet. You might also want to try that one as well.

Hi Borgar et al,


This is exactly what I'm after for my external windows keyboard for my M1 MBA! :)


3 Questions:

Q1) Does this work on BigSur?

Q2) How do I make a backup of previous settings? (In case I mess it up!)

Q3) Does the MacOS now hold the new mapping? I.e. when I restart the MBA, would it keep these settings?


Hope you MacOS scripting bods can advise! :)



Best wishes
Martin
 
Hi MacOS scripting whizz kids :)


Please can you advise if the below 2 sets of code are ok to plug in, to get the "END" and "HOME" keys to work as expected on Big Sur, for off the shelf £15 windows wired keyboards?




-------------------------------------------------------------------------------------
Code set 1: From Apple community
Hopefully I can just plug this in and I'm away.
It has been over 15 years since I've done any unix command line stuff! :)



Source for this variation:
https://discussions.apple.com/thread/251108215?answerId=252138948022#252138948022
Instructions:
Run this at the command line, perhaps within Terminal or iterm2:


mkdir -p $HOME/Library/KeyBindings

echo
'{
/* 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 */
}'
> $HOME/Library/KeyBindings/DefaultKeyBinding.dict






----------------------------------------------------------------------------------------------------
Code set 2: From Borgar's Wed link above
I'm struggling to use this one, as I've never scripted on a Mac before.

Link to Borgar's help page:
https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x
Instructions:
Home to send you to the start of the line and not to the top of the document, then create a file called DefaultKeyBinding.dict in your ~/Library/KeyBindings folder (might need to create that folder too) with the following contents:

{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}




Hope you can advise :)


Kind regards
Martin
 
  • Like
Reactions: lil'schneezey
Hi All,


OK, giving this Modification idea a go today... hhhmmm :)



I've also found a cool YouTube video about using a key modifier app:


I'll see if this app is usable instead. It has some cool looking functions:
1. Profiles - Default, so anyone can use - then my modifications.
2. Per App mods
3. Multiple press downs possible etc.
 
  • Like
Reactions: Marty_Macfly
Try deleting the directory/file you created. Go to the library and delete the file. Might need to restart after.

Code:
~/Library/KeyBindings

Hi Ben,

Many thanks for the suggestion

Just tried that - it didn't work :(


Any other ideas? :)

Will give AppleCare a call tomorrow about this now, I reckon.


Regards
Martin
 
:)...testing testing...

Yeeeeesss! I got it to work at last!

Heart in my mouth time again.... last time I messed up the keyboard....
 
OK Guys,


***************************
** A Working solution for this ***
***************************
Applicable for M1 Macs on Big Sur:


1. Ignore all the web sites etc above


2. Go to the website below and follow the instructions exactly:
https://www.iexplain.org/remap-home-and-end-buttons-for-external-keyboard-on-mac/



Ta-da, works like a charm! :)
Best wishes
Martin


PS:
For my other essential work UI tip for MacOS:
https://forums.macrumors.com/thread...right-of-screen-best-key-combination.2290660/



------------------------------------------------------------------------------------------------------
The instructions, in case the web link goes down:

Fire up your favorite terminal (you’re probably using iTerm2 like the rest of the world)

mkdir -p ~/Library/KeyBindings
nano ~/Library/KeyBindings/DefaultKeyBinding.dict


The seasoned programmer could just go vi ~/Library/KeyBindings/DefaultKeyBinding.dict or more likely vim, but for the rest of us, nano works like a regular text editor.

In the empty file you just opened, copy and paste the following:

{
/* 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:";
}

Having pasted it into the file, press ctrl + x and answer with y when you get the question if you want to save.

Well that’s it. Now you have successfully remapped the home and en button for macOS. You need to restart to make the changes happen.
 
Last edited:
  • Like
Reactions: bwh1248
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.