Skip to content

Instantly share code, notes, and snippets.

@hyagni
Created March 31, 2011 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyagni/895673 to your computer and use it in GitHub Desktop.
Save hyagni/895673 to your computer and use it in GitHub Desktop.
By hooking KeyBoardQuit on keysnail, disable caret browse mode and hide panorama with C-g. C-g means that I want to back to normal browsing.
hook.setHook('KeyBoardQuit', function (aEvent) {
if (key.currentKeySequence.length) {
return;
}
command.closeFindBar();
var marked = command.marked(aEvent);
if (util.isCaretEnabled()) {
if (marked) {
command.resetMark(aEvent);
} else {
if ("blur" in aEvent.target) {
aEvent.target.blur();
}
gBrowser.focus();
_content.focus();
}
util.setBoolPref("accessibility.browsewithcaret", false);
} else {
TabView.hide();
goDoCommand("cmd_selectNone");
}
if (KeySnail.windowType === "navigator:browser" && !marked) {
key.generateKey(aEvent.originalTarget, KeyEvent.DOM_VK_ESCAPE, true);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment