From 717f34cbba08b8fd9285ae2ddc46c82f30310eef Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 11 May 2012 16:00:40 +0900 Subject: [PATCH] update keybind --- _keysnail.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 65a31b4..1faca42 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -558,6 +558,12 @@ key.setGlobalKey('C-l', function (ev, arg) { ext.exec("hok-start-foreground-mode", arg, ev); }, 'Start Hit a Hint foreground mode', true); +key.setGlobalKey('', function (ev, arg) { + let (elem = document.commandDispatcher.focusedElement) elem && elem.blur(); + gBrowser.focus(); + content.focus(); +}, 'コンテンツへフォーカス', true); + key.setViewKey('c', function (ev) { command.interpreter(); }, 'JavaScript のコードを評価'); @@ -696,7 +702,12 @@ key.setViewKey([[''], ['']], function (ev, arg) { return; }, 'ignore'); -key.setViewKey([[':'], ['P']], function (ev, arg) { +key.setViewKey(':', function (ev, arg) { + return !document.getElementById("keysnail-prompt").hidden && + document.getElementById("keysnail-prompt-textbox").focus(); +}, 'KeySnail のプロンプトへフォーカス', true); + +key.setGlobalKey('C-p', function (ev, arg) { return !document.getElementById("keysnail-prompt").hidden && document.getElementById("keysnail-prompt-textbox").focus(); }, 'KeySnail のプロンプトへフォーカス', true); @@ -732,9 +743,3 @@ key.setViewKey('T', function (ev, arg) { key.setEditKey('C-', function (ev) { command.walkInputElement(command.elementsRetrieverTextarea, true, true); }, '次のテキストエリアへフォーカス'); - -key.setGlobalKey('', function (ev, arg) { - let(elem = document.commandDispatcher.focusedElement) elem && elem.blur(); - gBrowser.focus(); - content.focus(); -}, 'コンテンツへフォーカス', true);