-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Generate RawKeyEvents for iOS 13.4+ #65193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I just realized that i did not use gen_keycodes.dart to generate the key map. Will work on that. |
|
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 (with only very few missing).
|
|
@KammererTob Thanks SO MUCH for this PR. This is clearly a lot of work, and we have needed keyboard support on iOS for quite a while now. I'll be looking over this PR and sending you some feedback soon, but I just wanted to say "thank you" first. |
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks quite good, just some naming issues.
They aren't actually used yet, but are part of our (currently underway) effort to migrate all of this platform specific code into the engine. (see https://flutter.dev/go/platform-based-key-events)
Thanks, this should have been removed as part of our non-nullable-by-default migration which is currently in progress.
That seems like the right place to put it to me. |
|
FYI @dkwingsmt, who is doing the platform based key event migration. |
|
@gspencergoog Thanks! I can't find any issues that gspencergoog hasn't. (There is yet another case of |
|
Thanks for the review and explanations! I have made the requested changes, and also renamed some more variables to be more in line with the requested naming scheme (if this went too far, then i will revert it if needed). |
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@KammererTob looks like this needs to have a conflict resolved, but once that happens, I can land it, since the corresponding engine change has landed now. |
|
@gspencergoog I resolved the merge conflict so it should be g2g |

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
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