This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
Report shifted writing system keys correctly in Chromium 62+ - #238
Merged
Merged
Conversation
daviwil
force-pushed
the
dw-fix-shifted-keys
branch
from
February 17, 2019 21:12
ac9393e to
4206457
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
This change fixes an issue introduced somewhere around Chromium 62 (I looked for a while and couldn't find an explicit record of this) which causes "shifted" writing system keys to be reported in their non-shifted form in the
KeyboardEvent.keyproperty (e.g[instead of{when shift is held). I believe the former behavior was considered a bug in Chromium so we're now adjusting to the new behavior since it's considered correct.The fix is to use
KeyboardEvent.codeto look up the shifted version of any writing system key despite whatKeyboardEvent.keyis reporting. I've had to be pretty surgical with where I introduced this change so that I don't negatively affect other key handling workarounds, specifically those related to the use of theAltmodifier.This PR also updates the way we run tests for this repo since
devtoolis no longer maintained and well behind the latest Chromium version.Alternate Designs
There might be a better logic flow that could be used here but it would take a much longer period of refactoring. This solution was the simplest that fixed the issue without negatively impacting other cases.
Benefits
Key combinations like cmd+{ are now correctly reported in Atom built on Electron 3.0.
Possible Drawbacks
None that I'm aware of.
Applicable Issues
Fixes #237