Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGenerate RawKeyEvents for iOS 13.4+ #65193
Open
+1,554
−288
Conversation
|
I just realized that i did not use gen_keycodes.dart to generate the key map. Will work on that. |
flutter-dashboard
bot
commented
Sep 3, 2020
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. |
|
I have now made the iOS key code mapping generatable and collectable from the chromium files. This works since the key codes used for iOS are bascially the usbHidCodes (which only very few missing).
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


KammererTob commentedSep 3, 2020
This is based on the UIKey introduction in 13.4 and this PR: flutter/engine#20972
Description
This PR generates
RawKeyEventDatafor iOS and in turnRawKeyDownEventandRawKeyUpEventappropriately.The mapping for the keyCodes to
PhysicalKeyboardKeyswas done based on this documentation: https://developer.apple.com/documentation/uikit/uikeyboardhidusage?language=objc, which seems to be a complete copy of the usage table found here: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdfI have not included every key listed there since they seemed to be very hardware specific, but i can add them if desired.
I also noticed that the
RawKeyDownEventhas acharacterproperty which is filled withmessage['character']. This does not work for MacOs and iOS since it is called "characters" for both of them. I was not sure if this was intentional or an oversight. Should this be changed to "character" for iOS and MacOS?This PR depends on an engine PR: flutter/engine#20972, although it should not be breaking even without this.
Related Issues
#31945
Tests
I added iOS as a platform to the already excellent tests for the other platforms. I also added specific tests for iOS in the style of other tests already existing for other platforms.
Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change