Skip to content

Commit ecd61d4

Browse files
committed
Improve Option key tracking to only activate when the window is active
1 parent 5f3f9c8 commit ecd61d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Flitro/Editor/ContextDetailsView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,12 @@ struct ContextButton: View {
309309
.buttonStyle(.plain)
310310
.help(buttonHelpText)
311311
.onReceive(Timer.publish(every: 0.1, on: .main, in: .common).autoconnect()) { _ in
312-
// Check for Option key state periodically
313-
isOptionPressed = NSEvent.modifierFlags.contains(.option)
312+
// Only track Option key when window is active
313+
if NSApp.isActive {
314+
isOptionPressed = NSEvent.modifierFlags.contains(.option)
315+
} else {
316+
isOptionPressed = false
317+
}
314318
}
315319
}
316320

0 commit comments

Comments
 (0)