Skip to content

Commit

Permalink
Update iOS KeyCodeMap dictionary literal and migrate to ARC (#51981)
Browse files Browse the repository at this point in the history
Framework template updated in flutter/flutter#146481.  See [gen_keycodes README](https://github.com/flutter/flutter/tree/master/dev/tools/gen_keycodes ) for details.

Fixes flutter/flutter#146480 `-Wobjc-redundant-literal-use` error.

Note `-Wobjc-redundant-literal-use` is already on for clang-tidy 
https://github.com/flutter/engine/blob/6dc91bff96a56513a57ed5dd036fb16d25c945fd/.clang-tidy#L13 but in this case it's only true triggered when the file is compiled with ARC.  When I migrated this file to ARC as part of flutter/flutter#137801, it triggered the error.
  • Loading branch information
jmagman authored Apr 11, 2024
1 parent 1fb2a7a commit 76a270f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ source_set("flutter_framework_source_arc") {
"framework/Source/FlutterTextInputPlugin.mm",
"framework/Source/FlutterTextureRegistryRelay.h",
"framework/Source/FlutterTextureRegistryRelay.mm",
"framework/Source/KeyCodeMap.g.mm",
"framework/Source/KeyCodeMap_Internal.h",
"framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.h",
"framework/Source/UIViewController+FlutterScreenAndSceneIfLoaded.mm",
]
Expand Down Expand Up @@ -129,8 +131,6 @@ source_set("flutter_framework_source") {
"framework/Source/FlutterView.mm",
"framework/Source/FlutterViewController.mm",
"framework/Source/FlutterViewController_Internal.h",
"framework/Source/KeyCodeMap.g.mm",
"framework/Source/KeyCodeMap_Internal.h",
"framework/Source/SemanticsObject.h",
"framework/Source/SemanticsObject.mm",
"framework/Source/accessibility_bridge.h",
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/darwin/ios/framework/Source/KeyCodeMap.g.mm
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
};

API_AVAILABLE(ios(13.4))
NSDictionary<NSString*, NSNumber*>* specialKeyMapping = [[NSDictionary alloc] initWithDictionary:@{
NSDictionary<NSString*, NSNumber*>* specialKeyMapping = @{
@"UIKeyInputEscape" : @(0x10000001b),
@"UIKeyInputF1" : @(0x100000801),
@"UIKeyInputF2" : @(0x100000802),
Expand All @@ -351,7 +351,7 @@
@"UIKeyInputEnd" : @(0x10000000d),
@"UIKeyInputPageUp" : @(0x100000308),
@"UIKeyInputPageDown" : @(0x100000307),
}];
};

const uint64_t kCapsLockPhysicalKey = 0x00070039;
const uint64_t kCapsLockLogicalKey = 0x100000104;

0 comments on commit 76a270f

Please sign in to comment.