• Andrew Xu's avatar
    Fix the bug that Launcher is triggered unexpectedly · 531197df
    Andrew Xu authored
    The key code which is created by KeyEvent rewriting is stored
    in AcceleratorHistory when the key button is pressed. However,
    there is no code responsible for removing it when the key button
    is released. Instead only the key code before KeyEvent rewriting
    is erased. As result, the accelerators relying on the state of
    AcceleratorHistory often have unexpected behavior when KeyEvent
    rewriting is triggered (The comment under this issue gives detailed
    explanation).
    
    In this CL, EventRewriterChromeOS stores the pressed keys. Based on
    it, EventRewriterChromeOS computes the rewritten event and the rewritten
    status. In addition, the test on edge cases is added.
    
    Bug: 913209
    Test: unit_tests
    Change-Id: Ie22fe2ba8a2bd296628032723acc721db2616a77
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1477959Reviewed-by: default avatarKevin Schoedel <kpschoedel@chromium.org>
    Reviewed-by: default avatarWez <wez@chromium.org>
    Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
    Commit-Queue: Andrew Xu <andrewxu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#638756}
    531197df
event_rewriter_chromeos.cc 55.2 KB