Update keysnail.js

This commit is contained in:
Tom Willemse 2015-11-17 21:29:25 +01:00
parent 03baab2134
commit 80edf526d3

View file

@ -1,15 +1,21 @@
// ========================== KeySnail Init File =========================== // // ======================= KeySnail Init File ======================== //
/*global key plugins hook command util*/ /*global key plugins hook command util gBrowser _content goDoCommand
// You can preserve your code in this area when generating the init file using GUI. * KeySnail KeyEvent userscript ext openHelpLink
// Put all your code except special key, set*key, hook, blacklist. * BrowserCloseTabOrWindow closeWindow undoCloseTab OpenBrowserWindow
// ========================================================================= // * getBrowser goQuitApplication saveDocument toJavaScriptConsole
* display shell BrowserReload BrowserBack BrowserForward content*/
// You can preserve your code in this area when generating the init
// file using GUI. Put all your code except special key, set*key,
// hook, blacklist.
// =================================================================== //
//{{%PRESERVE% //{{%PRESERVE%
// Put your codes here // Put your codes here
plugins.options["hok.hint_keys"] = "arstdhneio"; plugins.options["hok.hint_keys"] = "arstdhneio";
plugins.options['bmany.default_open_type'] = 'tab';
//}}%PRESERVE% //}}%PRESERVE%
// ========================================================================= // // =================================================================== //
// ========================= Special key settings ========================== // // ====================== Special key settings ======================= //
key.quitKey = "C-g"; key.quitKey = "C-g";
key.helpKey = "<f1>"; key.helpKey = "<f1>";
@ -22,7 +28,7 @@ key.negativeArgument1Key = "C--";
key.negativeArgument2Key = "C-M--"; key.negativeArgument2Key = "C-M--";
key.negativeArgument3Key = "M--"; key.negativeArgument3Key = "M--";
// ================================= Hooks ================================= // // ============================== Hooks ============================== //
hook.addToHook('KeyBoardQuit', function (aEvent) { hook.addToHook('KeyBoardQuit', function (aEvent) {
if (key.currentKeySequence.length) if (key.currentKeySequence.length)
@ -57,7 +63,7 @@ hook.addToHook('KeyBoardQuit', function (aEvent) {
} }
}); });
// ============================= Key bindings ============================== // // ========================== Key bindings =========================== //
key.setGlobalKey('C-M-r', function (ev) { key.setGlobalKey('C-M-r', function (ev) {
userscript.reload(); userscript.reload();
@ -362,7 +368,7 @@ key.setViewKey('h', function (ev) {
getBrowser().mTabContainer.advanceSelectedTab(-1, true); getBrowser().mTabContainer.advanceSelectedTab(-1, true);
}, 'Select previous tab', false); }, 'Select previous tab', false);
key.setViewKey(':', function (ev, arg) { key.setViewKey('x', function (ev, arg) {
shell.input(null, arg); shell.input(null, arg);
}, 'List and execute commands', true); }, 'List and execute commands', true);
@ -519,3 +525,19 @@ key.setCaretKey(["C-x", "h"], function (ev) {
key.setCaretKey('f', function (ev) { key.setCaretKey('f', function (ev) {
command.focusElement(command.elementsRetrieverTextarea, 0); command.focusElement(command.elementsRetrieverTextarea, 0);
}, 'Focus to the first textarea', true); }, 'Focus to the first textarea', true);
key.setViewKey([':', 'b'], function (ev, arg) {
ext.exec("bmany-list-all-bookmarks", arg, ev);
}, 'bmany - List all bookmarks');
key.setViewKey([':', 'B'], function (ev, arg) {
ext.exec("bmany-list-bookmarklets", arg, ev);
}, "bmany - List all bookmarklets");
key.setViewKey([':', 'k'], function (ev, arg) {
ext.exec("bmany-list-bookmarks-with-keyword", arg, ev);
}, "bmany - List bookmarks with keyword");
key.setViewKey([':', 't'], function (ev, arg) {
ext.exec("bmany-list-bookmarks-with-tag", arg, ev);
}, "bmany - List bookmarks with tag");