How to map end key to "end of line"

Is there a way to map the "end" key so that it goes to the end of the line, rather than the end of the document? I know I can use clover-right arrow to go to end of line, but I would like to map the end key to this functionality. Conversely, I'd like to map the home key to beginning of line.

Thanks.

iMac, Mac OS X (10.5.4)

Posted on Aug 28, 2008 9:06 AM

Reply
12 replies

Aug 28, 2008 11:38 AM in response to fuzzydog

fuzzydog wrote:
Command right arrow key accomplishes this.


The OP is aware of that which wrote:
_I know I can use clover-right arrow to go to end of line_

He want an other shortcut:
_I would like to map the end key to this functionality_

Check out keyboard shortcuts in pages help.


I often write that but this time I'm not sure that it was useful 😉

Yvan KOENIG (from FRANCE jeudi 28 août 2008 20:38:08)

Aug 30, 2008 10:28 PM in response to auratio

You can try macro software like

Quickeys [http://www.macupdate.com/info.php/id/6134/quickeys-x]

*Keyboard Maestro* [http://www.macupdate.com/info.php/id/6265/keyboard-maestro]

KeyQuencer [http://www.tucows.com/preview/206894]

However I strongly recommend you don't fiddle with your User Interface. Learn the fairly straight forward Apple keyboard shortcuts which are nearly universal.

Aug 31, 2008 12:26 AM in response to auratio

Your wish is quite reasonable. I don't like the Cmd left/right arrow too.
You can often use Ctrl-A to go to the start of a line and Ctrl-E to go to the end of line.

First of all, have a look at this web page by Jacob Rus:

http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html

A good explanation of key related things.

In your personal Library folder create a folder KeyBindings.
Then copy the following (starting on the line with { and ending on the line with }).
(this will also make Shift Home and Shift End select to the start/end of line)


{
/* home */
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";

/* end */
"\UF72B" = "moveToEndOfLine:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
}


Paste this as PLAIN TEXT in an empty file in your favorite text editor (Smultron?) and save the file as

~/Library/KeyBindings/DefaultKeyBinding.dict

(NB: use Unix line endings)
(NB. You can do much more with keybindings
Logout and login again and you should have what you want.

This will work in most applications using the Cocoa text system.
But not in some: Safari in the address field and in the Google search box; you have to use Ctrl-A and Ctrl-E.

Berend

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to map end key to "end of line"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.