diff options
| author | Stephen Blott | 2015-03-09 08:49:37 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-03-09 08:49:37 +0000 | 
| commit | f407fe2feba1ffa4ac3fdd50e431ac51b8ec630f (patch) | |
| tree | 05894fd4e1bd06066f70bf708e5969e10fa5205f /content_scripts/mode.coffee | |
| parent | fabe391e80e9f90b656786fb58795b9769457253 (diff) | |
| download | vimium-f407fe2feba1ffa4ac3fdd50e431ac51b8ec630f.tar.bz2 | |
Pass keyup events after entering link-hint mode.
The page (or another extension) sees keydown events (such as shift)
before entering link-hint mode.  So we need to also pass the
corresponding keyup events.
Fixes #1522.
Diffstat (limited to 'content_scripts/mode.coffee')
| -rw-r--r-- | content_scripts/mode.coffee | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee index fa583a1c..bded402c 100644 --- a/content_scripts/mode.coffee +++ b/content_scripts/mode.coffee @@ -120,6 +120,16 @@ class Mode              @registerStateChange?()          registerKeyQueue: ({ keyQueue: keyQueue }) => @alwaysContinueBubbling => @keyQueue = keyQueue +    # If @options.passInitialKeyupEvents is set, then we pass initial non-printable keyup events to the page +    # or to other extensions (because the corresponding keydown events were passed).  This is used when +    # activating link hints, see #1522. +    if @options.passInitialKeyupEvents +      @push +        _name: "mode-#{@id}/passInitialKeyupEvents" +        keydown: => @alwaysContinueBubbling -> handlerStack.remove() +        keyup: (event) => +          if KeyboardUtils.isPrintable event then @stopBubblingAndFalse else @stopBubblingAndTrue +      Mode.modes.push @      Mode.updateBadge()      @logModes() | 
