This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[macOS, Keyboard] Duplicate down events are no longer ignored, but kept and preceded by up events #31800
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.

Before this PR, duplicate down events are regularized by ignoring the latter events.
For example, native KeyA down, KeyA down will result in Flutter KeyA down, (empty).
This PR changes so that the latter events are kept, and, for regularization purposes, preceded by synthesized up events. The example above will now result in Flutter KeyA down, (KeyA up) KeyA down. This change is similar to #30488, but for a different reason.
This fixes the macOS part (which is the last part) of flutter/flutter#82673. When using this Vietnamese IME and typing "laf", the
fkey down event will be converted to many events, including a key down event with keyCode 0 (KeyA) and character "à". However, if the typing is so fast that the A key is not released when the F key is pressed (which happens a lot), the current strategy will take the forged KeyA down event as a duplicate down event, ignore it by returning true, and this event will not be passed to the text input plugin.Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.