• David Reveman's avatar
    exo: Fix key event rewrite support. · 94a6f1a7
    David Reveman authored
    Use a map to track pressed keys. The key for the map is the physical
    code that was pressed and the value is a potentially rewritten code.
    
    This allows us to generate appropriate release events when physical
    keys are released, while still allowing the event rewriting logic
    to work as expected.
    
    Note: Exo clients will always see a release for the same code as
    the code that was generated when the physical key was pressed. This
    is necessary in order to not break client side keyboard state
    tracking and might not match the events that are generated internally.
    That is because event rewrite logic is usually not rewriting both the
    press and the release events, often just the press event.
    
    Bug: 847500
    Test: exo_unittests --gtest_filter=KeyboardTest.OnKeyboardKey
    Tbr: hidehiko@chromium.org
    Change-Id: I23240304bd377e3855971edd079ade1b537a74f9
    Reviewed-on: https://chromium-review.googlesource.com/1112967Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
    Commit-Queue: David Reveman <reveman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#570074}
    94a6f1a7
keyboard_delegate.h 1.61 KB