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

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Aug 6, 2021

This PR fixes several issues related to Win32 Keyboard:

The PR also covers some new use cases, such as:

  • Multibyte characters with keyboard.

This PR also adds an "integration test" for the Win32 keyboard system, taking the Win32Window, KeyboardKeyHandler, TextInputPlugin, and KeyboardKeyEmbedderHandler. This is because, due to reasons explained in flutter/flutter#88021, the current single-class unit tests no longer provide us enough guarantee how a key press actually works. The "integration test" is also a preparation for a possible rework in the future that is explained in flutter/flutter#88021.

This PR implements WmBuilders to simulate precise Win32 messages for keyboard unit tests, and implemented MockMessageQueue, simulating a message queue that supports PeekMessage.

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 dkwingsmt changed the title Win keyboard unittests Windows keyboard integration tests and fix a number of issues Aug 11, 2021
@dkwingsmt dkwingsmt marked this pull request as ready for review August 11, 2021 06:01
@dkwingsmt dkwingsmt requested a review from gspencergoog August 11, 2021 07:37
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

WM_KEYDOWN, 0, false, false),
true);
EXPECT_EQ(handler.KeyboardHook(nullptr, VK_LMENU, kScanCodeAltLeft,
EXPECT_EQ(handler.KeyboardHook(nullptr, VK_RMENU, kScanCodeAltLeft,
Copy link
Contributor

Choose a reason for hiding this comment

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

Were these just all using the wrong side of the keyboard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kind of. Previously the code that resolves side does not work very well and will send LMENU when right alt is pressed.

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
@marcoprodata
Copy link

In portuguese when use accents the application close. test with áéãõâô

@dkwingsmt
Copy link
Contributor Author

In portuguese when use accents the application close. test with áéãõâô

Sorry about the crash. Can you file an issue on flutter/flutter for tracking?

@marcoprodata
Copy link

In portuguese when use accents the application close. test with áéãõâô

Sorry about the crash. Can you file an issue on flutter/flutter for tracking?

Ok, added, thanks for your attention

filmil pushed a commit to filmil/engine that referenced this pull request Apr 21, 2022
…r#27921)

* Basic changes

* Fix build

* Revert some changes

* Fix tests (ATP)

* Win32Message and inject messagelist

* wm builders

* Format

* Correct

* LowerCaseAUnhandled

* ShiftLeftKeyA

* Ctrl-A

* Ctrl-1

* Digit1OnFrenchLayout

* AltGrKeyQ

* Dead key E

* ^1

* Multibyte

* Format

* License

* Revert key.dart

* Move CreateKeyEventLparam

* MockEmbedderApiForKeyboard

* More MockEmbedderApiForKeyboard

* Doc

* Move MockMessageQueue

* is_deadchar doesnt seem needed

* ConvertChar32ToUtf8

* PeekNextMessageType

* Format

* Apply suggestions from code review

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants