Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Move the cursor during Page Up, Page Down scrolling System
When you hit Page Up or Page Down in certain OS X programs (TextEdit for one), the cursor position normally doesn't move; only your scroll position does. As a result, typing or using an arrow key will zoom you back to the cursor position. If you prefer to move the cursor position too, hold Option along with Page Up or Page Down. You can add in Shift to select the text, too.

[robg adds: This won't work in every app; I couldn't make it work in Mail in 10.5, for instance. It worked in TextEdit in both 10.5 and 10.6, though.]
    •    
  • Currently 2.71 / 5
  You rated: 5 / 5 (21 votes cast)
 
[13,736 views]  

Move the cursor during Page Up, Page Down scrolling | 6 comments | Create New Account
Click here to return to the 'Move the cursor during Page Up, Page Down scrolling' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Move the cursor during Page Up, Page Down scrolling
Authored by: bhas on Dec 08, '09 09:36:36AM

Interesting.
It also doesn't work in TextWrangler 3.

You can achieve the same effect by making a DefaultkeyBinding.dict in ~/Library/KeyBindings
and putting the following in that file

{

/* page up/down with moving insertion point, caret */
"\UF72C" = "pageUp:";
"\UF72D" = "pageDown:";

/* Option/Alt + PgUp/PgDn */
"~\UF72C" = "scrollPageUp:";
"~\UF72D" = "scrollPageDown:";
}

which is what I have done. I can't get used to the cursor not moving when I do an unmodified PgUp and PgDn.

You can do much more than just this. See <a href=http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html>this page</a> by Jacob Rus.

Berend



[ Reply to This | # ]
Move the cursor during Page Up, Page Down scrolling
Authored by: lrivers on Dec 09, '09 06:44:27AM

Old School Mac apps (TextWrangler, for instance) already do this with command-up arrow.



[ Reply to This | # ]
Move the cursor during Page Up, Page Down scrolling
Authored by: barefootguru on Jan 31, '10 03:16:20PM

TextWrangler is option-down arrow and option up-arrow to scroll a page and move the cursor.



[ Reply to This | # ]
Move the cursor during Page Up, Page Down scrolling
Authored by: interlard on Dec 10, '09 08:18:54PM

Sweet! I agree, the default Mac behavior is horrible. It's far more common for me to use the keyboard to jump around a document because I'd like to type something when I get there. Leaving the cursor behind is a very rare case.

Thanks for posting the key binding thing!



[ Reply to This | # ]
Move the cursor during Page Up, Page Down scrolling
Authored by: The_Anakin on Dec 09, '09 06:00:15AM

Awesome! This "jump-back" behavior has been annoying me for years! A terrible user interface decision. Thanks a lot for this hint!



[ Reply to This | # ]
Move the cursor during Page Up, Page Down scrolling
Authored by: herbs on Dec 10, '09 01:36:09PM

Howdy,

If you use Ctl-V will page down and move the cursor (vertically centered in the window). The corresponding command to page up is unbound but you can build a DefaultKeyBinding.dict file (either in plist format or a `c'-like format) that binds that and many other commands. See <http://www.macosxhints.com/article.php?story=20060317045211408&lsrc=osxh> and <http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html> for more information.

Good Luck,
Herb Schulz

PS: I use

/* Example of DefaultKeyBinding.dict using text format */
{
"^u" = "capitalizeWord:";
"^U" = "uppercaseWord:";
"~^u" = "lowercaseWord:";
"~v" = "pageUp:";
"^x" = {
" " = "setMark:";
"^m" = "selectToMark:";
"^x" = ("swapWithMark:" , "centerSelectionInVisibleArea:");
};
}


---
Good Luck,
Herb Schulz



[ Reply to This | # ]