Firebug hotkey fix

by Martin on 30/06/2008

I might be the only one with this problem, but in case that isn’t true I thought I’d write up a short one.

I love (Nay; Depend on!) Firebug for my HTML/CSS/JS work and I also hate having to use the mouse if I can get stuff done with a keystroke instead. (I’ll be writing a series of posts on how to avoid the mouse as much as possible in the near future.)

Firebug does come with a predefined hotkey to open/close the panel, but sadly that hotkey is F12 which I’ve already mapped to Exposé and am unwilling to give up. In theory This should be easy to fix by going to the System Preferences -> Keyboard And Mouse -> Keyboard Shortcuts panel and remapping there, but however much I tried I couldn’t get this to work. The solution? Risky and potentially ruinous hardcoding hackery of the plugin itself.

What I did was navigate to the .xul file within the Firebug folder buried deep within the user Library. The path below shows you where to find this file.

~Library/Application Support/Firefox/Profiles/nil9olmf.default/Extensions/firebug@software.joehewitt.com/content/firebug/browserOverlay.xul

Having opened this file in a text editor (preferably TextMate) I just did a search for the string “F12″, and lo and behold:

1
2
3
4
5
6
<keyset id="mainKeyset">
<key id="key_toggleFirebug" keycode="VK_F12"
command="cmd_toggleFirebug"/>
<key id="key_detachFirebug" keycode="VK_F12" modifiers="accel"
command="cmd_detachFirebug"/>
</keyset>

This line seemed pretty much what I was looking for. Crossing my fingers and with a silent prayer I merely changed the “VK_12″s to “VK_F2″s and Bob was, as they say, my uncle.

As is pretty much the case with anything I perpetrate against my Mac I don’t recommend you do this unless you’re ready to face the consequences. (I can’t imagine they’d be any more severe than having to reinstall Firebug, but still…) Chances are the problem only showed up in the first place because of my irresponsible messing about with stuff I should’ve left alone, but if you do have the same problem, here’s the fix.

Be aware also that you’ll have to repeat this procedure every time you update Firebug, so you may want to bookmark this blog and come back every day for the rest of your life.

There are 4 comments in this article:

  1. 18/08/2008Bookmarks about Firebug says:

    [...] – bookmarked by 1 members originally found by robbowley on 2008-07-23 Firebug hotkey fix http://unitedstatesofmartin.net/?p=45 – bookmarked by 3 members originally found by dradicke on [...]

  2. 17/11/2008Geraint Howell says:

    I had a similar problem trying to focus the command line (normally shift+control+L on XP).

    Tracked it down to the file C:\Documents and Settings\{username}\Application Data\Mozilla\Firefox\Profiles\1zebwoll.default\extensions\firebug@software.joehewitt.com\content\firebug\firebugOverlay.xul

    In there, there’s an element

    I changed key=”l” to key=”m”, and now I can focus the command line, albeit with a non-standard keystroke.

    Many thanks for you post.

  3. 17/11/2008Geraint Howell says:

    The element hasn’t been rendered in my previous comment. Ok, I’ll try encoding as html:

    <key id=”key_focusCommandLine” key=”m” modifiers=”accel,shift” class=”fbOnlyKey” command=”cmd_focusCommandLine”/>

  4. 21/11/2008Geraint Howell says:

    It turns out that you can use a Firefox extension called “keyconfig” to very easily remap hot keys.

    http://forums.mozillazine.org/viewtopic.php?t=72994

Write a comment: