engine icon indicating copy to clipboard operation
engine copied to clipboard

[Web, Keyboard] Implement `FlutterHtmlKeyboardEvent.keyCode` and `defaultPrevented`, and rename `Keyboard` to `RawKeyboard`

Open dkwingsmt opened this issue 3 years ago • 0 comments

This PR implements keyCode and defaultPrevented of FlutterHtmlKeyboardEvent. The keyCode was deemed useful in an earlier PR but was missing from this class, while defaultPrevented replaces a long-standing hack used by keyboard_converter_test.dart. No semantic changes are made to the tests, except for line 613 and line 637 where the results are changed to true because the previous results are no longer cleared.

Also, this PR renames Keyboard to RawKeyboard. Started as the only keyboard processor, Keyboard now handles the legacy "raw keyboard" system, one of the two keyboard processing systems. The rename aligns with its role change, and is a precursor to a later change, where we embed RawKeyboard as part of KeyboardBinding so that the two processing systems can share the same event listeners as entrances.

Other minor changes include:

  • Extract MockKeyboardEvent into a separate file, and implemement its modifierState.
  • Remove KeyboardBinding's now redundant parameter glassPaneElement.

Pre-launch Checklist

  • [ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [ ] I read the Tree Hygiene wiki page, which explains my responsibilities.
  • [ ] I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • [ ] I listed at least one issue that this PR fixes in the description above.
  • [ ] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • [ ] I updated/added relevant documentation (doc comments with ///).
  • [ ] I signed the CLA.
  • [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

dkwingsmt avatar Jul 13 '22 02:07 dkwingsmt