From b7b1aaac0c11539a21e73913ae085d18fb80275a Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 14 Sep 2007 04:37:45 +0000 Subject: [PATCH] merge keyDown event handling from MAIN - helps with sites such as yahoo.com which trap all keyDown events --- chrome/content/vimperator/events.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js index d234c002..b7fce475 100644 --- a/chrome/content/vimperator/events.js +++ b/chrome/content/vimperator/events.js @@ -611,6 +611,18 @@ function Events() //{{{ } window.addEventListener("keypress", this.onKeyPress, true); + // this is need for sites like msn.com which focus the input field on keydown + this.onKeyDown = function(event) + { + if (vimperator.modes.passNextKey ^ vimperator.modes.passAllKeys || isFormElemFocused()) + return true; + + event.preventDefault(); + event.stopPropagation(); + return false; + } + window.addEventListener("keydown", this.onKeyDown, true); + this.progressListener = { QueryInterface: function(aIID)