Keyconfig extension

From MozillaZine Knowledge Base
Revision as of 09:21, 12 January 2007 by Rod Whiteley (talk | contribs) (→‎Tips: mention DOM Inspector)
Jump to navigationJump to search

The extension Keyconfig allows you to configure keyboard shortcuts. It works with Firefox, Thunderbird, and (probably) the Mozilla Suite. Shortcuts defined via a key can be changed. For more details, [1].

Keyconfig's user interface

Keyconfig has a user interface for working with keyboard shortcuts. For example, if you have installed the Keyconfig extension, here is how you can compact the current folder in Thunderbird by using the shortcut Alt-C:

  1. In Thunderbird, choose: Tools – Keyconfig... The Keyconfig dialog opens.
  2. At the bottom of the Keyconfig dialog, press the button "Add a new key". The Key editor dialog opens.
  3. Name the key: Compact This Folder (You can use any name—it does not affect the operation of the key.)
  4. Copy and paste the following code sample where you see the comment /*CODE*/:
  5. goDoCommand("cmd_compactFolder")
  6. Press OK to close the Key editor.
  7. Go to the field at the bottom of the Keyconfig dialog, and press the key combination Alt+C. (Do not type the characters A l t + C, but instead hold down the Alt key and press the C key.)
  8. Press the Apply button, then the Close button.
  9. Restart Thunderbird.

Tips

  • You can add preferences for custom keys to the prefs.js file in your profile folder to get the described results. All instances of Firefox, Thunderbird, or Mozilla must be closed before editing this file. After editing start the browser and open the Keyconfig window to set your keyboard shortcut. Attention: Don't add these preferences to your user.js file because they are applied again with the next start and the assigned keyboard shortcuts will be deleted.
  • If you have technical knowledge of Mozilla applications, then you can use the DOM Inspector extension to discover how existing elements in the user interface work, helping you to develop code for new keyboard shortcuts.

Template

user_pref("keyconfig.main.xxx_key__NAME", "!][][][FUNCTION");

Examples