MozillaZine

Keyconfig extension

From MozillaZine Knowledge Base

(Difference between revisions)
Revision as of 14:37, 18 January 2005
Christian Bischoff (Talk | contribs)

<-- Previous diff
Revision as of 14:49, 18 January 2005
Asqueella (Talk | contribs)
(Custom keys - put in a <pre>; someone fix linebreaks.)
Next diff -->
Line 9: Line 9:
==Custom keys== ==Custom keys==
- +<pre>
/* Template */ /* Template */
user_pref("keyconfig.main.xxx_key__NAME", "!][][][FUNCTION"); user_pref("keyconfig.main.xxx_key__NAME", "!][][][FUNCTION");
Line 39: Line 39:
/* Extension: Menu Editor */ /* Extension: Menu Editor */
user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');"); user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');");
 +</pre>

Revision as of 14:49, 18 January 2005

Description of Keyconfig

The extension Keyconfig allows you to change keyboard shortcuts. [Firefox, Thunderbird, SeaMonkey (maybe)]

Shortcuts defined via a key can be changed but only changing those which itself call a function (those with a command or oncommand attribute) has an effect (all others fulfill only cosmetic purposes it seems and are grayed out). That means you can change the shortcut for "Decrement URL" (Magpie) but not for "Undo Close Tab" (Tabbrowser Extensions).

You can add the following lines to the file prefs.js in your profile to get the described results. All instances of Firefox must be closed before editing this file. After editing start Firefox and open the Keyconfig window to add your keyboard shortcut.

You could also add the lines to you user.js, but after starting Firefox you have to delete the lines from the user.js. If you won't delete them, they will be applied again with the next Firefox start and will overwrite (delete) the assigned keyboard shortcuts.

Custom keys

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

/* Firefox */
user_pref("keyconfig.main.xxx_key__Extensions", "!][][][BrowserOpenExtensions('extensions');");
user_pref("keyconfig.main.xxx_key__Manage Bookmarks", "!][][][toOpenWindowByType('bookmarks:manager', 'chrome://browser/content/bookmarks/bookmarksManager.xul');");
user_pref("keyconfig.main.xxx_key__Next Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(1);");
user_pref("keyconfig.main.xxx_key__Previous Tab", "!][][][gBrowser.mTabContainer.advanceSelectedTab(-1);");
user_pref("keyconfig.main.xxx_key__Reload All Tabs", "!][][][gBrowser.reloadAllTabs();");
user_pref("keyconfig.main.xxx_key__Themes", "!][][][BrowserOpenExtensions('themes');");

/* Thunderbird */
user_pref("keyconfig.main.xxx_key__Display Attachments Inline", "!][][][ToggleInlineAttachment(event.target);");
user_pref("keyconfig.main.xxx_key__Rewrap", "!][][][goDoCommand('cmd_rewrap');");
user_pref("keyconfig.main.xxx_key__Run Filters on Folder", "!][][][goDoCommand('cmd_applyFilters');");
user_pref("keyconfig.main.xxx_key__Run Junk Mail Controls On Folder", "!][][][goDoCommand('cmd_runJunkControls');");
user_pref("keyconfig.main.xxx_key__Send Unsent Messages", "!][][][goDoCommand('cmd_sendUnsentMsgs');");
/* contributed by ausdilecce */ 
user_pref("keyconfig.main.xxx_key__Mark Msg Answered", "!][][][var hdr=GetDBView().hdrForFirstSelectedMessage; GetDBView().db.MarkHdrReplied(hdr,true,null);");
user_pref("keyconfig.main.xxx_key__Unmark Msg Answered", "!][][][var hdr=GetDBView().hdrForFirstSelectedMessage; GetDBView().db.MarkHdrReplied(hdr,false,null);"); 

/* Extension: miniT */
user_pref("keyconfig.main.xxx_key__Move Tab -> End", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mTabContainer.childNodes.length-1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Left", "!][][][if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal-1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Right", "!][][][if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab.ordinal+1);");
user_pref("keyconfig.main.xxx_key__Move Tab -> Start", "!][][][gBrowser.moveTabTo(gBrowser.mCurrentTab,0);");

/* Extension: Menu Editor */
user_pref("keyconfig.main.xxx_key__Menu Editor", "!][][][openDialog('chrome://menuedit/content/menueditprefs.xul','', 'resizable');");