diff options
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 07b430ba..24cc25c3 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -460,14 +460,16 @@ onKeypress = (event) -> else if (!isInsertMode() && !findMode) if (isPassKey keyChar) return handlerStack.stopBubblingAndTrue - if currentCompletionKeys.indexOf(keyChar) != -1 or isValidFirstKey(keyChar) or - # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input - # element. So we should also block other keystrokes (otherwise, it's weird). - InsertModeBlocker.isActive() + if currentCompletionKeys.indexOf(keyChar) != -1 or isValidFirstKey(keyChar) DomUtils.suppressEvent(event) keyPort.postMessage({ keyChar:keyChar, frameId:frameId }) + if InsertModeBlocker.isActive() + # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input + # element. So we should also block other keystrokes (otherwise, it's weird). + DomUtils.suppressEvent(event) + return true onKeydown = (event) -> @@ -558,10 +560,12 @@ onKeydown = (event) -> # TOOD(ilya): Revisit this. Not sure it's the absolute best approach. if (keyChar == "" && !isInsertMode() && (currentCompletionKeys.indexOf(KeyboardUtils.getKeyChar(event)) != -1 || - isValidFirstKey(KeyboardUtils.getKeyChar(event)) || - # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input - # element. So we should also block other keystrokes (otherwise, it's weird). - InsertModeBlocker.isActive())) + isValidFirstKey(KeyboardUtils.getKeyChar(event)))) + DomUtils.suppressPropagation(event) + KeydownEvents.push event + else if InsertModeBlocker.isActive() + # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input + # element. So we should also block other keystrokes (otherwise, it's weird). DomUtils.suppressPropagation(event) KeydownEvents.push event |
