Use command line editing keys in Cocoa apps
Mar 30, '01 08:26:59PM
Contributed by: Anonymous
Ok, here's one for all the UNIX geeks!
All Cocoa apps respond to familiar commandline controls. This is what I mean, go into a Cocoa application (Omniweb, TextEdit, anything that is not Carbon or Classic) and click on any text field.
Type some random stuff, then press CTRL-A, it will bring the cursor to the beginning of that line, which is a common control in UNIX command lines. [Note: CTRL = the control key]
Read the rest of the article if you'd like to learn a number of other keyboard shortcuts for text editing in Cocoa apps.
[Editor's note: This isn't really just for UNIX geeks. How many times have you wanted a quick way to navigate around a text box without using the mouse?! Learn a few of these shortcuts, and free yourself from the mouse!]
Stuff you can already do with other keys:
- ctrl-a = brings cursor to the beginning of a line
- ctrl-d = deletes the letter in FRONT of the cursor
- ctrl-e = brings cursor to the end of a line
- ctrl-k = erases an entire line in front of the cursor
- ctrl-o = acts like return, but cursor stay in the same place
- ctrl-t = brings the letter that is behind the cursor move forward one, switching places with the next letter.
- ctrl-v = moves cursor to the end of a document, or line
- ctrl-w = deletes everything behind the cursor.
- ctrl-x = WEIRD STUFF, not sure.. maybe a more geeky UNIX person than me can tell us what this is supposed to do. (Very slow response and some weird characters)
- ctrl-y = yeah...don't know what this does either.
- ctrl-b = left arrow
- ctrl-f = right arrow
- ctrl-h = delete
- ctrl-i = tab
- ctrl-j = return
- ctrl-n = down arrow
- ctrl-p = up arrow
Mac OS X Hints