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

Disable Firefox's Command-Arrows page jump shortcuts Web Browsers
Within some online text editors, such as TinyMCE, Firefox (on a MacBook) will handle Command-Left Arrow as 'go back one page' rather than 'go to the start of the current line.' Likewise, Command-Right Arrow will take you forward a page, but if there's not a page to go forward to, this often results in moving the cursor to the end of the current line after all.

To see this in action, go here, and from that page, go to Examples and then to Documentation. Now, go back one page. On the Examples page, change some text and hit Command-Left Arrow while the cursor is still within the editor. Firefox will take you back another page, losing any changes you made. If you try the same thing in Safari, it would simply move the cursor to the start of the current line. Likewise, for Command-Right Arrow, Firefox takes you forward to Documentation, where Safari would move the cursor to the end of the current line.

The solution is simple -- use the keyconfig add-on. After installing keyconfig, go to Tools » Keyconfig, click on the "Back : Command-Left Arrow" entry, then click the Disable button. Next, select the "Forward : Command-Right Arrow" entry and click Disable. That's all. To navigate from page to page, use Command-[ and Command-].

While we're at the subject, if you don't want Delete/Backspace to take you the previous page when your cursor happens to be outside any textbox, see this hint. You could probably accomplish the same result by using keyconfig by disable the "Back : Backspace" shortcut.

[robg adds: When I tested this hint in Firefox 3.0.5, the modified text in the TinyMCE editor showed up, even after going forward or back away from the page. If you're interested in learning more about keyconfig, this hint explains in a bit more depth about how to use it to set up your own keyboard shortcuts for commands that don't have menu item entries.]
    •    
  • Currently 2.92 / 5
  You rated: 5 / 5 (13 votes cast)
 
[20,975 views]  

Disable Firefox's Command-Arrows page jump shortcuts | 16 comments | Create New Account
Click here to return to the 'Disable Firefox's Command-Arrows page jump shortcuts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: bengarland on Jan 23, '09 11:09:51AM

This hint is not really needed. The author is using the wrong key commands. You shouldn't be using CMD-Arrow to move around in text boxes. Using the Control key commands below is more efficient and thorough.

The correct commands are (originally from Emacs)...

CURSOR MOVEMENT:

<CTRL>f move the cursor forward one character.

<CTRL>b move the cursor backward one character.

<CTRL>e move the cursor to the end of the current line.

<CTRL>a move the cursor to the beginning of the current line.

<CTRL>p move the cursor to the previous line.

<CTRL>n move the cursor to the next line.

TEXT MANIPULATION:

<CTRL>o open a new line at the cursor.

<CTRL>d delete the character at the cursor.

<CTRL>k kill from the cursor to the end of the current line.

<CTRL>t transpose the character at the cursor with the one to the left of it

<CTRL>y yank back (restore) the most recent deletion done by any of the above kill commands or by a copy.



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: palahala on Jan 23, '09 01:11:09PM
Ok, you may have a point here: if these shortcuts work for all programs then learning them might be a good idea. But the text input that I am using right now to write this very comment, does not recognize Ctrl-O, Ctrl-T and Ctrl-Y -- not too important to me, but: why? Furthermore, I simply feel that Command-Arrow should behave the same in each program.

Those who're following the labels on small keyboards might use Fn-Arrow rather than Command-Arrow to get Home, End, Page Up and Page Down. However, those will soon find that programs behave differently for Fn-Arrow. For example: TextEdit seems to ignore Fn-Left (while Command-Left goes to the start of the current line), and Fn-Up scrolls without moving the caret (while Command-Up moves the cursor to the start of the document). Some programs handle Fn-Up as "start of document", while others make the cursor move the start of the line. While still using NeoOffice, I have often swapped two lines by hitting Command-Arrow or Fn-Arrow... So yes, I should have learned the Ctrl shortcuts ;-)

In my experience, Cmd-Arrow behaves the same in many programs I use today. If not, then it's never too destructive -- apart from loosing text in Firefox.

As for robg's remark: when using the example at http://tinymce.moxiecode.com/ then one might indeed not really lose any text when, after accidentally moving away from the editor using Command-Left, one goes back to the editor (using Command-Right). However, many of those editors are populated using JavaScript. Using, for example, rich text editors in the TYPO3 CMS I have lost my changes many times, as moving back to the editor simply loaded the existing content from the database.


[ Reply to This | # ]
Re: Disable Firefox's Command-Arrows page jump shortcuts
Authored by: Uncle Asad on Jan 23, '09 06:24:30PM
This hint is not really needed. The author is using the wrong key commands. You shouldn't be using CMD-Arrow to move around in text boxes.

"Wrong" says who? Cmd-Left Arrow has always moved to the beginning of the line (and Cmd-Right Arrow to the end of the line) in the "classic" Mac OS and in Mac OS X.

There's no reason why users shouldn't expect standard Mac OS X key bindings to work everywhere; this is clearly a bug in Firefox.

[ Reply to This | # ]
Re: Disable Firefox's Command-Arrows page jump shortcuts
Authored by: palahala on Jan 24, '09 05:05:25AM

Thanks for that great link to the Apple Human Interface Guidelines.

I assume that holding down Fn on small Apple keyboards, while pressing Left Arrow or Right Arrow, will in fact send a program the keycodes for Home and End just as the key labels show. In other words: I assume programs do not need to detect Fn themselves. This makes me wonder why even Apple's TextEdit does not follow the guidelines for those keys...

Home, End

Pressing the Home key is equivalent to moving the scrollers all the way to the top and to the left. In a text document, for example, pressing Home scrolls to the beginning of the document; in a spreadsheet, it may scroll to the beginning of the spreadsheet or to the beginning of a row. These keys should also work in scrolling lists to display the top or bottom of the list.

End is the opposite of Home: It scrolls to the end of a document.

If the beginning or end of the document is already reached, pressing Home or End produces a system alert sound. Pressing the Home or End key has no effect on the location of the insertion point or selected data.

I also find it odd that Apple has introduced new keyboard layouts on 2nd or 3rd generation MacBooks and the aluminum keyboards, using F3 for Exposť and F4 for Dashboard -- while the guidelines still only mention F9-F12 as being reserved.

And finally, I never understood why Apple cannot sell the US keyboard layout in Europe -- not even when specifically asked to do so. I know, layout and keycodes are not the same thing. But here in the Netherlands we get a very tiny Return key, and an odd location of the backtick, to the left of the Z-key.



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: ret on Jan 28, '09 05:23:50PM
What an outrageous idea! It's not the user doing the wrong thing when FF breaks conventions used (virtually) everywhere else. Adherence to HIG principles and conventions is a big part of what makes the Mac experience.

Now, if the key-bindings matched Vi instead of Emacs, that would be another story. ** He says, ducking for cover ;-) **

---
perl -e 'require Signature.pm; srand; printf STDOUT "%s\n", $Signature[rand @Signature];'

[ Reply to This | # ]

Disable Firefox's Command-Arrows page jump shortcuts
Authored by: Mac Dose on Jan 23, '09 10:01:52PM

Great hint, thanks. This was driving me nuts.



[ Reply to This | # ]
Awesome! Thanks So much!
Authored by: jzacsh on Jan 25, '09 01:32:59PM

This is awesome! I love it, I wanted to look up a solution for this a long time ago, and ended up just learning how to be really careful when I'm in a text-editor I'm not familiar with.

Bit off topic: .. I've noticed that gmail in firefox has some quirky reactions when writing an email as well.

Thanks again!

---
--
jzacsh



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: ret on Jan 28, '09 05:40:29PM

I've lost count of the number of times I've lost work in Mambo/Joomla on account of this idiosyncratic behaviour, which is exacerbated by the fact that it's the only thing I use FF for.

Thank you so much for the tip.

---
perl -e 'require Signature.pm; srand; printf STDOUT "%s\n", $Signature[rand @Signature];'



[ Reply to This | # ]
Can this be done without keyconfig?
Authored by: jpmm on Feb 23, '09 02:58:49PM

Does anyone know how to do this WITHOUT using the keyconfig program. The reason I ask is because this add-on is from a third-party site and not on Firefox's Add-Ons (well it is but outdated, apparently). I don't feel comfortable installing it. But, if I knew how do it manually, I'd give it a shot.



[ Reply to This | # ]
Can this be done without keyconfig?
Authored by: palahala on Mar 28, '09 07:06:44AM
Does anyone know how to do this WITHOUT using the keyconfig program.

On my quest to find the keyconfig solution, I read that some people use keyfixer instead, which patches some keymapping files. I don't recall if I tried that, but today it actually seems more difficult to me.

On Hackzines.com (now part of makezine.com) you can read about using DefaultKeyBinding.dict, but that did not work for me.



[ Reply to This | # ]
Can this be done without keyconfig?
Authored by: palahala on Mar 28, '09 07:27:16AM
some people use keyfixer instead, which patches some keymapping files [..] it actually seems more difficult to me

Correction to the above comment about keyfixer: there's a more recent blog post on Heisencoder that describes version 0.4.x, which is in fact a Firefox and Thunderbird add-on now.

I have not used it; please let us know if it works for you!



[ Reply to This | # ]
Can this be done without keyconfig?
Authored by: palahala on Mar 29, '09 10:18:05AM
And meanwhile the author of keyfixer has replied to be using keyconfig rather than keyfixer to fix the Cmd-Left issue:
I confirmed that TinyMCE still has the Cmd-Left problem, and I've been personally using keyconfig to fix it. I don't think that the approach used by keyfixer (i.e., modifying the platformHTMLBindings.xml file) can fix this.


[ Reply to This | # ]
Can this be done without keyconfig?
Authored by: jpmm on Apr 01, '09 11:02:07AM

Thanks for your input. I would really like to find a solution that doesn't use keyconfig simply because I do not feel comfortable with it Not being available from the Firefox Add-Ons page (on there, it hasn't been updated since Jan. 2007). For now, I have just set text areas to plain text (where possible) and try really hard to remember to NOT press Command Arrows in DHTML editors (e.g. TinyMCE).



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: palahala on Apr 13, '09 05:43:47AM

The problem with losing text from a rich-text editor when pressing Cmd-Left Arrow still exists in Firefox 3.1 beta (which will become Firefox 3.5 one day). While keyconfig is not yet declared compatible with the newer versions, here's how to get keyconfig running in Firefox 3.1 beta/3.5. After doing so, hitting Cmd-Left Arrow just gets you to the beginning of the current line, rather than taking you all the way back to the previous page:

  • Install Nightly Tester Tools. Next, if you already had keyconfig installed, right-click keyconfig in the Extensions pane of the Tools, Add-ons window, and select "Override compatibility". If you did not yet install keyconfig in Firefox 3.0, then you'll get the same option when installing the current version in Firefox 3.1 beta/3.5. (As a side note: for any other outdated add-on at addons.mozilla.org you'd first need to select "See All Versions", as otherwise the "Add to Firefox" button will be disabled.)
  • Or, more complicated: follow the instructions in Editing an add-on to change its compatibility.

In the list of keyconfig's bindings (menu Tools, Keyconfig) you'll now have to disable "goBackKb: Cmd-Left Arrow" and "goForwardKb: Cmd-Right Arrow". I'm not sure why these "goBackKb" and "goForwardKb" are no longer translated into "Back" and "Forward" like in Firefox 3.0, but the effect is the same.

The keyconfig settings can also be seen when typing about:config in the location bar, and then searching for keyconfig.



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: DJF3 on May 06, '11 06:57:49AM

I have installed the Keyfixer 0.5 in Firefox 4 but CMD-LEFT still takes me to the previous page.

This is quite annoying when you're typing in an online text-editor and you want to use CMD-Left to move one word backwards.

Was anyone able to fix this?



[ Reply to This | # ]
Disable Firefox's Command-Arrows page jump shortcuts
Authored by: sridhar on Feb 29, '12 08:55:03AM

I use KeyConfig and it solves the problem as mentioned in the article.



[ Reply to This | # ]