Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated HoK plugin.
- prevent keydown & keyup event when hok.start
  • Loading branch information
hogelog committed Feb 27, 2010
1 parent dfc22fe commit eac6d8d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/hok.ks.js
Expand Up @@ -962,6 +962,8 @@ var hok = function () {
}

document.removeEventListener('keypress', onKeyPress, true);
document.removeEventListener('keydown', preventEvent, true);
document.removeEventListener('keyup', preventEvent, true);
}

display.echoStatusBar("");
Expand Down Expand Up @@ -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")
{
Expand Down Expand Up @@ -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, ...
Expand Down

0 comments on commit eac6d8d

Please sign in to comment.