diff --git a/NEWS b/NEWS index 78f77f2c..ccdc7105 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@
2007-xx-xx:
* version 0.6
+ * sites like msn.com or yahoo.com don't focus search field anymore on keydown
* new gi browser command to focus last used input box
* edit TEXTAREAs with many vim commands in a vim and even visual mode if you :set noinsertmode
* support for emacs/bash-like ctrl-e/a/u/k/h keys in single line text fields
diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js
index b2aab836..ee6c3eb8 100644
--- a/chrome/content/vimperator/events.js
+++ b/chrome/content/vimperator/events.js
@@ -703,6 +703,20 @@ 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.hasMode(vimperator.modes.ESCAPE_ONE_KEY) && !vimperator.hasMode(vimperator.modes.ESCAPE_ALL_KEYS)) ||
+ (vimperator.hasMode(vimperator.modes.ESCAPE_ALL_KEYS) && !vimperator.hasMode(vimperator.modes.ESCAPE_ONE_KEY)) ||
+ isFormElemFocused())
+ return true;
+
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ }
+ window.addEventListener("keydown", this.onKeyDown, true);
+
this.progressListener =
{
QueryInterface: function(aIID)