This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
shell/platform/darwin/macos/framework/Source Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,13 @@ - (nonnull instancetype)initWithChannel:(nonnull FlutterBasicMessageChannel*)cha
4242
4343// / Checks single modifier flag from event flags and sends appropriate key event
4444// / if it is different from the previous state.
45- - (void )checkModifierFlag : (NSUInteger )modifierFlag
46- forEventFlags : (NSEventModifierFlags )modifierFlags
45+ - (void )checkModifierFlag : (NSUInteger )targetMask
46+ forEventFlags : (NSEventModifierFlags )eventFlags
4747 keyCode : (NSUInteger )keyCode
4848 timestamp : (NSTimeInterval )timestamp {
49- if ((modifierFlags & modifierFlag) != (_previouslyPressedFlags & modifierFlag)) {
50- uint64_t newFlags = (_previouslyPressedFlags & ~modifierFlag) | (modifierFlags & modifierFlag);
49+ NSAssert ((targetMask & (targetMask - 1 )) == 0, @"targetMask must only have one bit set");
50+ if ((eventFlags & targetMask) != (_previouslyPressedFlags & targetMask)) {
51+ uint64_t newFlags = (_previouslyPressedFlags & ~targetMask) | (eventFlags & targetMask);
5152
5253 // Sets combined flag if either left or right modifier is pressed, unsets otherwise.
5354 auto updateCombinedFlag = [&](uint64_t side1, uint64_t side2, NSEventModifierFlags flag) {
You can’t perform that action at this time.
0 commit comments