Permalink
Browse files

Updated HoK plugin.

- prevent keydown & keyup event when hok.start
  • Loading branch information...
hogelog committed Feb 27, 2010
1 parent dfc22fe commit eac6d8db9399b4ebff8d8b25022aa7a08d010d8b
Showing with 11 additions and 0 deletions.
  1. +11 −0 plugins/hok.ks.js
View
@@ -962,6 +962,8 @@ var hok = function () {
}
document.removeEventListener('keypress', onKeyPress, true);
+ document.removeEventListener('keydown', preventEvent, true);
+ document.removeEventListener('keyup', preventEvent, true);
}
display.echoStatusBar("");
@@ -1050,6 +1052,11 @@ var hok = function () {
}
}
+ function preventEvent(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
function setLocalQuery() {
if (plugins.options["hok.local_queries"] && typeof content.location.href == "string")
{
@@ -1112,7 +1119,11 @@ var hok = function () {
// util.message((endDate - fromDate) + " msec");
if (hintCount > 1)
+ {
document.addEventListener('keypress', onKeyPress, true);
+ document.addEventListener('keydown', preventEvent, true);
+ document.addEventListener('keyup', preventEvent, true);
+ }
else
{
// remove hints, recover keysnail's keyhandler, ...

0 comments on commit eac6d8d

Please sign in to comment.