This repository has been archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Window, Keyboard] Fix repeat events of modifier keys #35046
Merged
auto-submit
merged 5 commits into
flutter:main
from
dkwingsmt:fix-win-key-modifier-repeat
Aug 1, 2022
Merged
[Window, Keyboard] Fix repeat events of modifier keys #35046
auto-submit
merged 5 commits into
flutter:main
from
dkwingsmt:fix-win-key-modifier-repeat
Aug 1, 2022
Conversation
This file contains 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
gspencergoog
approved these changes
Aug 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -424,8 +429,18 @@ void KeyboardKeyEmbedderHandler::SynchronizeCritialPressedStates( | |||
if (is_event_down) { | |||
// For down events, this key is the event key if they have the same | |||
// virtual key, because virtual key represents "functionality." | |||
// | |||
// In that case, normally Flutter should synthesize nothing since the | |||
// resulting event can adapt to the current state by flexing between a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flexing? Do you just mean that it swaps its state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I phrased it into "the resulting event can adapt to the current state by dispatching either a down or a repeat event". Hopefully this is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that works.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Aug 1, 2022
8 tasks
betrevisan
pushed a commit
to betrevisan/engine
that referenced
this pull request
Aug 5, 2022
emilyabest
pushed a commit
to emilyabest/engine
that referenced
this pull request
Aug 12, 2022
Doflatango
added a commit
to Doflatango/flutter-webview-windows
that referenced
this pull request
Oct 18, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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.
Fixes flutter/flutter#108646 .
The synchronization logic revised in #33746 always synchronizes the pre-event state of a modifier key to be "released". This is problematic since it disallows repeat events. With this PR, pressing synchronization no longer handles down events of the event key except in one scenario where the event key's toggling state has just been synchronized. However, this exception is not trivial and requires communication between the two synchronization function. The approach adopted by this PR is a little ugly, but it works. Maybe one day we will hate it and find a better way.
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.