Hacker News new | ask | show | jobs
by pilif 4767 days ago
The one thing that drives me mad about Firefox on the Mac is it's Home/End behavior. Ever since migrating to the Mac, I have remapped the keys to work like on windows and Linux (operating on the current line instead of the current document).

You can do that using a custom key binding in ~/Library/KeyBindings.

Firefox ignores this and still insists on home/end working on the full document. But even worse: in the new Gmail compose window, not even Command-Left/Right works (it does in other Textareas - no idea what Google did here).

Now this might totally be a case of http://xkcd.com/1172/ but by the life of me, I cannot work without a way to move the cursor to the beginning of a line - especially when the keys that I usually use are so destructive (scrolling all the way to the top, making me lose my position).

This is the only reason why using Firefox is out of the question.

In the past, I patched some JS file inside the bundle, but now that Firefox updates so often and it's a signed binary, I can't really do that any more.

4 comments

>The one thing that drives me mad about Firefox on the Mac is it's Home/End behavior. Ever since migrating to the Mac, I have remapped the keys to work like on windows and Linux (operating on the current line instead of the current document)

That's because Home and End keys on the Mac, like in the original UNIX, mean the beginning and the end of the document not the beginning and end of a line which is a Windows thing (and since Windows is the overwhelming presence, is commonly misunderstood as the keys themselves meaning that) and since most early Linux desktop environment's aimed to duplicate Windows, is also the default Linux behaviour now.

You will find this behaviour in all Apple provided applications as well.

> I cannot work without a way to move the cursor to the beginning of a line

Anything that doesn't override Cocoa's default key bindings will be able to use the emacs key bindings as well (Cntrl-A for the beginning and Cntrl-E for the end of the line)

>in the new Gmail compose window, not even Command-Left/Right works

cntrl-a and cntrl-e work.

> You will find this behaviour in all Apple provided applications as well.

not on my machine. As I said, I used ~/Library/KeyBindings/DefaultKeyBinding.dict to change it. If the OS provides a way to change defaults, I expect applications to respect that too - no matter the historical reasons.

> >in the new Gmail compose window, not even Command-Left/Right works

> cntrl-a and cntrl-e work.

Yes, but Command-Left/Right is something that worked on the Mac even since before OSX. I, again, see no reason why it wouldn't work here.

If the application overrides the defaults (which is fairly common ), your changing the defaults does nothing (for that application and for the keys that might have been overridden). It sounds like Firefox overrides the defaults completely but in it's override "map" keeps some of the functionality the same as the default.

I havn't used it but this claims it will change the Firefox behaviour as well (specifically make them behave like windows for the home and end keys)

https://addons.mozilla.org/en-US/firefox/addon/keyfixer/

I think cmd-left and cmd-right are used by Firefox for " back" and "forward" so those never work on Firefox (unless perhaps you go find where Firefox specifies its key bindings and change them)

Better link

http://www-archive.mozilla.org/unix/customizing.html#keys

sounds like

cmd_beginLine cmd_endLine

are what you need to modify in the example given

  <binding id="editorUser">
    <handlers>
      <handler event="keypress" key="w" modifiers="control"
       command="cmd_deleteWordBackward"/>
    </handlers>
  </binding>
>That's because Home and End keys on the Mac, like in the original UNIX, mean the beginning and the end of the document not the beginning and end of a line which is a Windows thing

Is it? I'm used to them going to the beginning and the end of lines on Linux.

The very next line you quoted tells you why that is the case on Linux now. if you used Linux in the late 90's, you will remember that a lot of the popular window managers/desktop environments aimed to make your transition from Windows 95 easier and the current Linux behaviour is a result of that.
I'm not talking about GUIs. I mean in text editors and at the Terminal.
>and since most early Linux desktop environment's aimed to duplicate Windows, is also the default Linux behaviour now.
> ...new Gmail compose window, not even Command-Left/Right works (it does in other Textareas - no idea what Google did here)

It drives me crazy too. At one point I used a workaround mentioned in the bug discussion[1], but I have no idea if it still works. I decided to support Mozilla/Firefox and just got used to control+a/e within Gmail.

[1]https://bugzilla.mozilla.org/show_bug.cgi?id=289384#c63

CMD-Arrow (left,right,up,down) will move you to the beginning of the line, end of line, start of document,end of document respectively. I really miss these keys when I am on windows as I find it much less of a hand movement to do.
Yeah. It just doesn't work in Gmail's new compose window in Firefox. No idea why.
Home/End go to the beginning/end of a page on linux/windows. (Unless you are referring to the behaviour in a text area).