-
Notifications
You must be signed in to change notification settings - Fork 6k
Hardware Keyboard: macOS #23469
Hardware Keyboard: macOS #23469
Conversation
|
@gspencergoog I have finished the fixes. Here are some non-trivial changes:
among other mostly doc changes. Can you take a look? Thanks! |
| // 0xF747 is actually used. Here we choose to filter out 0xF700-0xF7FF | ||
| // section. The reason for keeping the 0xF800-0xF8FF section is because | ||
| // 0xF8FF is used for the "Apple logo" character (Option-Shift-K on US | ||
| // keyboard.) |
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.
Can you document here why you're including the 0xF800-0xF8FE region? e.g. "The 0xF800-0xF8FE region is included in anticipation of any new private values that are printable."
Do you have any documentation that this is how they split it up, or is that just a feeling? If it's not just a feeling, including a link to that information would be good.
I'm still a little leery of making the assumption that the region will include printable characters, but the consequences aren't huge, so I guess it's OK.
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.
I understand. It is indeed only a feeling, and a result out of experimentation. The only documentation I can find is the one I included that reserves 0xF700-0xF8FF. Since we're trusting the official documentation, the doc only declared a limited number of values (https://developer.apple.com/documentation/appkit/1535851-function-key_unicodes?language=objc), all of which are within 0xF700-0xF747. I'll add a little more to the doc. We can always come back and adjust this range anyway.
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.
How does this look?
// Some function keys are assigned characters with codepoints from the
// private use area. These characters are filtered out since they're
// unprintable.
//
// The official documentation reserves 0xF700-0xF8FF as private use area
// (https://developer.apple.com/documentation/appkit/1535851-function-key_unicodes?language=objc).
// But macOS seems to only use a reduced range of it. The official doc
// defines a few constants, all of which are within 0xF700-0xF747.
// (https://developer.apple.com/documentation/appkit/1535851-function-key_unicodes?language=objc).
// This mostly aligns with the experimentation result, except for 0xF8FF,
// which is used for the "Apple logo" character (Option-Shift-K on a US
// keyboard.)
//
// We hereby assume that non-printable function keys are defined from
// 0xF700 upwards, and printable private keys are defined from 0xF8FF
// downwards. We want to keep the printable private keys, therefore
// we only filter out 0xF700-0xF7FF.
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEmbedderKeyResponder.mm
Outdated
Show resolved
Hide resolved
| continue; | ||
| } | ||
| BOOL shouldDown = (currentFlagsOfInterest & currentFlag) != 0; | ||
| [self sendModifierEventOfType:shouldDown |
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.
Couldn't it just be a bitmask of the current modifier state? You could convert the bitmask to a platform-independent version here.
Actually, I guess it doesn't really matter much. It's not going to be THAT many events (like maybe four max per event).
|
@gspencergoog The reason why
I'm renaming it to |
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.
* b2d02f7 Roll Fuchsia Linux SDK from GsRYVri0-... to aRqEDMjwC... (flutter/engine#24990) * 3a1a3e6 Roll Skia from 7854da39b3c1 to 4fb13e026b6b (20 revisions) (flutter/engine#24993) * e3a84f9 Fixed issue where the gpu disable syncswitch was being overridden after init. (flutter/engine#24958) * aa83691 fix selectable text selections are not announced in voice over (flutter/engine#24933) * 04b0451 fixes reference retaining issue in flutter text input plugin (flutter/engine#24768) * 1ea7dc6 Set automatic simulator rotation in scenario test (flutter/engine#24985) * 38977a5 Implement AXPlatformNodeBase::GetInstanceCountForTesting (flutter/engine#24999) * a25b0de Roll Fuchsia Mac SDK from xOxFrRRO6... to pmsuWkRQA... (flutter/engine#24997) * 3270c87 Roll Skia from 4fb13e026b6b to 1aa25c3217b6 (25 revisions) (flutter/engine#25001) * 96d5104 [deferred components] Handle base module loading units (flutter/engine#24983) * 6a3d8c7 Roll Skia from 1aa25c3217b6 to ead52dc068d5 (1 revision) (flutter/engine#25005) * 0f52360 Hardware Keyboard: macOS (flutter/engine#23469)
The macOS changes for the Hardware Keyboard project.
The macOS changes for the Hardware Keyboard project.
| - (instancetype)initWithViewController:(FlutterViewController*)viewController { | ||
| self = [super init]; | ||
| if (self != nil) { | ||
| _flutterViewController = viewController; |
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.
Why do we remove the _flutterViewController? if we do want to remove it, we should remove all the reference to it and the private property as well. cc @dkwingsmt
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.
The reason I removed it is because it's not used after initializing _channel.
It's indeed an oversight for me not to remove the private property. I can submit a new PR if you agree with the removal.
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.
A later commit reused flutterViewController #24867, I think we should add it back
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.
Sure. Sorry for the confusion I caused.
Although I see #25524 is pending to fix the caret, can you just ask him to include this change?
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.
will do :)
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.
@dkwingsmt, #25524 already does it.
The macOS changes for the Hardware Keyboard project.

Description
This PR contains the macOS changes for the Hardware Keyboard project.
Classes has been adjusted as follows:
Related Issues
Tests
I added the following tests:
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.