Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Web] Synthesize modifiers key up based on known logical key #37280

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Nov 3, 2022

Description

Since #36724, modifier keys up and down events are synthesized on pointer events. This PR fixes an issue related to the logical key used to synthesize modifier keys up events. In some particular cases, a modifier key can be associated to several logical keys (for instance, the alt right physical key could be associated to AltRight or AltGr logical keys). This PR updates the modifier up event synthesization logic to synthesize up events using the logical key used for the down event.

This PR also contains the updated file lib/web_ui/lib/src/engine/key_map.g.dart (generated from the changes included in flutter/flutter#114499).

Related Issue

Fixes flutter/flutter#114504

Tests

Adds 1 test

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Nov 3, 2022
@bleroux bleroux requested a review from dkwingsmt November 3, 2022 14:28
@bleroux bleroux force-pushed the web_synthesize_modifier_key_up_using_known_logical_key branch from 91f60e7 to 01fb791 Compare November 3, 2022 21:11
@@ -635,12 +635,14 @@ class KeyboardConverter {

// Synthesize an up event for left key if pressed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we can remove the logicalRight in the parameter list.

_MouseEventContext(),
_TouchEventContext(),
],
'should synthesize modifier keys up event using known pressed logical key',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'should synthesize modifier keys up event using known pressed logical key',
'should synthesize modifier keys up event for AltGraph',

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for nits

@bleroux bleroux force-pushed the web_synthesize_modifier_key_up_using_known_logical_key branch from 01fb791 to 86eea35 Compare November 7, 2022 19:18
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 7, 2022
@auto-submit auto-submit bot merged commit df60207 into flutter:main Nov 7, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 7, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 7, 2022
…114847)

* 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129)

* b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390)

* df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
@bleroux bleroux deleted the web_synthesize_modifier_key_up_using_known_logical_key branch November 8, 2022 07:38
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Nov 9, 2022
…#37280)

Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
schwa423 pushed a commit to schwa423/engine that referenced this pull request Nov 16, 2022
…#37280)

Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#114847)

* 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129)

* b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390)

* df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#114847)

* 3d9f48580 [Embedder API] Introduce new semantics update callback (flutter/engine#37129)

* b673ce3c3 Roll Skia from da9fad017aee to dec7a930c0b7 (10 revisions) (flutter/engine#37390)

* df602070a [Web] Synthesize modifiers key up based on known logical key (flutter/engine#37280)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Web] Moving mouse while holding AltGr key throws
2 participants