2008-11-28

Keyfixer 0.4 for Firefox and Thunderbird

Firefox/Thunderbird keyfixer, starting with version 0.4, is now as a Mozilla Extension.

Keyfixer makes the keyboard bindings for Firefox or Thunderbird on Mac OS X behave like Windows. This is very useful for people who use both Windows and Mac (like I do), and don't want to have to continually remap your brain for each system

This new version is a regular Mozilla Extension (a type of Add-on), so now you don't have to uninstall and reinstall every time you upgrade Firefox.

Thanks to Jim Mendenhall of Starry Hope for the original version!

Let me know if you have any issues!

Cheers, -Matt

[Update: Version 0.4.2 is now available as a feature release to additionally bind the Control key instead of just the Command key. Some people prefer to use Control, and now you can use either...)

37 comments:

  1. Thanks for turning this into an extension!

    I think the shortcuts should use the "control" instead of the "accel" modifier though. E.g. cmd_wordNext should be Ctrl-Right and not Cmd-Right.

    ReplyDelete
  2. Hi Jan,

    I made it use "Cmd" instead of "Ctrl" because I have Cmd and Ctrl switched so that all the other applications behave more like Windows. If I used "Ctrl" in this extension, it would actually mess me up.

    To switch "Cmd" and "Ctrl", use the apple menu as follows:

    Apple Icon->System Preferences...->Keyboard & Mouse->Keyboard->Modifier Keys...

    Then change the Control (^) Key to use "Command", and the Command Key to use "^ Control".

    That said, if you still prefer keeping all your other applications more "Mac-like", you could probably directly replace the platformHTMLBindings.xml file directly with one taken from a Windows Firefox of the same version. This is a fairly quick hack, and if there's enough demand, I could look into adding a "Preferences..." Menu to keyfixer that would let you choose which version to use...

    Cheers, -Matt

    ReplyDelete
  3. Hi Matt,

    I understand why you personally want to do the mapping as is, but I think for an add-on hosted on mozilla.org you should either assume the default keyboard layout, or make this a preference that can be set using the GUI.

    I can certainly swap in my own keybindings file; I just hoped that using the extension would let me do it once and forget about it, even when I install FF updates.

    Cheers,
    -Jan

    ReplyDelete
  4. Jan -- Unfortunately, I don't know a way (without a lot of research) to allow customizations of the platformHTMLBindings.xml within a plugin. With just a few lines of code, I can substitute the whole XML file with another.

    That said, I think it would be possible (with little work) to double-bind most key shortcuts to both Ctrl and Cmd. In glancing over the bindings, I don't think this would cause a problem for the standard navigation and editing keys (arrows, PgUp, Home, Del etc).

    I'll turn a version 0.4.1 with these changes and let you give it a spin if you like... :)

    ReplyDelete
  5. Thanks! It works for me, although I had to manually install the update from your site; it didn't update through the mozilla add-on mechanism.

    ReplyDelete
  6. Thank you Jan for giving it a spin! I'll investigate the updating issue, although I suspect it didn't update because keyfixer is currently not public on Mozilla's site. This is my first Extension, so it's quite possible that I need to do something special to enable automatic updates. (Anyone know?)

    ReplyDelete
  7. Using this program since 0.2, I am really happy it's now an extension !
    No more resintalling "keyfixer" with every Firefox version.
    Thank a lot Matthew, I was so lost without theses 2 keys...

    ReplyDelete
  8. I just checked the Mozilla website, and people are not currently getting automatic updates because Mozilla hasn't yet made it public. Before Mozilla makes keyfixer public, it needs several reviews. So, if you want automatic updates to subsequent versions, please go to the mozilla keyfixer page and submit a review. Thanks!

    ReplyDelete
  9. Works Great! Thanks for the hard work. I just switched from windows to osx and little things like this drove me nuts.

    ReplyDelete
  10. Thanks for your work on this, very helpful!

    Greg

    ReplyDelete
  11. A preferences dialog would be most welcome. I'd like to be able to switch the behaviour of Ctrl-Left/Right to Alt-Left/Right since Spaces on Leopard already uses Ctrl-Left/Right

    ReplyDelete
  12. Olly: I've got Spaces disabled on my system, but I do remember running into some issues previously... :)

    Unfortunately, a configuration menu would be a large change -- I'd have to learn a whole lot more about extension programming. I wouldn't mind doing some of this for a "1.0" release, but as you'd expect, my time is somewhat limited.

    BTW, I think that Cmd-Left/Right should do what you want, in this case.

    ReplyDelete
  13. Just a quick thank you note. I've been annoyed by Firefox's behavior on the mac since day one and it took me a long time to work out which problems were mac inconsistencies (of which there were more than I expected) and which one were Firefox oddities. Between your excellent post at http://heisencoder.net/2008/04/fixing-up-mac-key-bindings-for-windows.html and this, I'm a very happy camper.

    Thank you for all of this work, it's really appreciated.

    ReplyDelete
  14. Thanks, I shudder to think how much time I've spent trying to get the HOME/END keys fixed on FF for Mac! Finally! :)

    ReplyDelete
  15. Hey... is there any way of changing it so that it retains Command-Left/Right as equivalent to Home/End? Right now Command-Left/Right jumps to the previous/next word, but in every other application it's Option-Left/Right that does that. I'd appreciate it because sometimes I'm not using my external keyboard. I saw Jan's comment earlier.. where's the platformHTMLBindings.xml file located?

    ReplyDelete
  16. Hi ambientnoise,

    I've added some rough instructions here: Hacking Keyfixer

    Basically, platformHTMLBindings.xml is stored within a zip within a zip. (i.e., the .jar file within the .xpi file).

    Let me know if these instructions give you the basics...

    ReplyDelete
  17. Hello, thank you for creating this add-on..

    Are you working on the 3.1b3 version of this add-on?

    ReplyDelete
  18. I got three messages this weekend asking for a 3.1b3 update, so I've pushed out a version 0.4.2 to the Mozilla website, with the only change to bump maxVersion to 3.2a1pre, which should now let keyfixer work on all 3.1 versions (including the released version, whenever that happens). Let me know if anyone see any problems...

    ReplyDelete
  19. Thanks a lot! You're clever even Steve Jobs:)

    ReplyDelete
  20. Does this also fix problems when hitting Cmd-Left while typing text in some richt-text editors? In some editors (such as TinyMCE) hitting Cmd-Left to go to the start of the current line makes Firefox go back to the previous page instead. If keyfixer does not prevent that, then an add-on named keyconfig might be helpful -- see http://www.macosxhints.com/article.php?story=20090118145518767

    ReplyDelete
  21. Arjan: Unfortunately, keyfixer does not fix the problem you mentioned. 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.

    ReplyDelete
  22. i have installed it & it works great for firefox, but has not worked for thunderbird at all

    is there something i;m not doing?

    cheers

    glen

    ReplyDelete
  23. Hi Glen:
    To help you, I need a bit more information. I've tested KeyFixer on Thunderbird 2.0.0.21 without issue. Could you provide more details, like:
    - Specifically, what are the issues you're seeing?
    - What version of Thunderbird are you running?
    - What other Extensions do you have installed?
    Thanks! -Matt

    ReplyDelete
  24. hi matt

    i thought when i added keyfixer from the official firefox add on site that it would also add it to thunderbird

    but i have just realised that the add on was not actually installed on thunderbird
    so i now have installed keyfixer directly from thunderbird and it is working fine

    thanks

    glen

    ReplyDelete
  25. command back does not work on google docs for me even with this installed. i have a unibody with firefox 3.5 installed

    ReplyDelete
  26. I've had trouble with Google products (in particular GMail). If it's particular to Google, then I don't think it's possible to fix it with the method that Keyfixer uses (this is probably buried somewhere in the way that Google redefines keystrokes with its JavaScript).

    ReplyDelete
  27. This fixes the BIGGEST single annoyance I've had since changing to a Macbook. I use GMail all day as my primary email, and bad behavior with the Home and End keys was maddening.

    THANK you for this.

    ReplyDelete
  28. Oh crap, I never knew why my fix OUTSIDE firefox didn't work inside gmail. Now I have home and end. Thank you SO MUCH!!!

    ReplyDelete
  29. This is a blessing!

    ReplyDelete
  30. Hey, I'm using FF v3.5.3, and OS X SL v10.6.1 on a new MBP 15". I just installed keyfixer v0.4.2, and it's not working in the compose windows of gmail.

    Admittedly, I also have KeyRemap4MacBook installed to get the same behavior outside of FF. Would that break keyfixer behavior?

    ReplyDelete
  31. id:

    Note that there is a known issue with Firefox and GMail compose (in Rich text editing mode), concerning the Cmd-Left/Cmd-Right mappings. GMail seems to snarf this up, probably through JavaScript. Maybe this is part of the problem?

    I've never seen KeyRemap4MacBook before, so I don't know the strategy it uses for doing the key remapping. The Keyfixer 0.1 strategy is to change the Cocoa default key bindings, and this method does not interfere with the Firefox KeyFixer 0.4.x because Firefox doesn't seem to use the Cocoa key bindings. If KeyRemap4MacBook uses a more general remapping, then it's quite possible that it interferes with Firefox KeyFixer.

    Anyone else have thoughts?

    ReplyDelete
  32. Using Firefox 4 now with 0.5 Keyfixer 0.5.

    For some reason the CMD-Left still takes me to the previous page (which is very annoying with online editors).

    How can that be fixed? Or should the keyfixer have done that for me?

    ReplyDelete
  33. DJ: Cmd-Left is very troublesome because this causes the browser to go to the previous page if a text box (or similar widget) doesn't have the input focus. I've gotten around this problem by installing the keyconfig extension (see http://mozilla.dorando.at/) and mapping Alt-Left instead of Cmd-Left for going to the previous page. I don't know an easy way to change KeyFixer to do this without a major revamp.

    ReplyDelete
  34. Is there an update in the works that will be usable in Thunderbird 5?

    ReplyDelete
  35. Robin: I haven't been planning to upgrade keyfixer for Thunderbird 5 since I don't use Thunderbird anymore. However, I could take a look. Is there a particular problem that you're running in to?

    ReplyDelete
  36. Okay, I did some quick checking, and it looks like Keyfixer 0.5 will work as-is in Thunderbird 5. I've updated the allowed versions on the Mozilla extensions page, so next time you search for extension updates, Keyfixer 0.5 should work again in Thunderbird 5 beta.

    ReplyDelete

Note: Only a member of this blog may post a comment.