Add screenshot release suppression#81
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a configurable “screenshot shortcut guard” to prevent ClickLight from showing the next mouse-up release highlight immediately after invoking the macOS screenshot selection shortcut (defaulting to ⌘⇧4). This fits into ClickLight’s existing event-capture → NotificationCenter → AppDelegate → Overlay pipeline by arming suppression on a matching keyDown and skipping the subsequent release event.
Changes:
- Introduces new settings (
suppressReleaseAfterShortcut,releaseSuppressionHotKey) persisted viaSettingsStore, with a default binding of ⌘⇧4. - Updates click capture to optionally observe keyDown events even when Live Keyboard Shortcuts are off (to detect the screenshot shortcut), and adds
bindingtoKeyboardShortcutEventfor reliable matching. - Adds UI controls and validation for the feature in the Settings window, plus README documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/ClickLight/SettingsWindowController.swift | Adds view-model state + conflict validation for the new screenshot suppression shortcut. |
| Sources/ClickLight/SettingsStore.swift | Persists new toggle + shortcut binding in UserDefaults; adds listensForReleaseSuppressionShortcut. |
| Sources/ClickLight/HotKeyBinding.swift | Adds the default ⌘⇧4 binding constant. |
| Sources/ClickLight/ClickLightSettingsView.swift | Adds “Screenshot Capture” settings UI (toggle + shortcut recorder). |
| Sources/ClickLight/ClickEventTap.swift | Extends capture start parameters and observes keyDown when needed; includes binding in shortcut events. |
| Sources/ClickLight/ClickEvent.swift | Extends KeyboardShortcutEvent with the originating HotKeyBinding. |
| Sources/ClickLight/ClickCaptureController.swift | Threads the new “observe suppression shortcut” flag into event-tap startup. |
| Sources/ClickLight/AppDelegate.swift | Arms release suppression on matching shortcut and suppresses the next release click event. |
| README.md | Documents the new feature and its Input Monitoring requirement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+313
to
+316
| if settings.releaseSuppressionHotKey == binding { | ||
| shortcutErrors[action] = "Matches Screenshot Shortcut. Choose a unique shortcut." | ||
| return false | ||
| } |
Comment on lines
+404
to
+406
| if settings.releaseSuppressionHotKey == binding { | ||
| errors[action] = "Matches Screenshot Shortcut. Choose a unique shortcut." | ||
| } |
| } | ||
|
|
||
| private static func findReleaseSuppressionShortcutConflict(in settings: ClickSettings) -> String? { | ||
| guard let binding = settings.releaseSuppressionHotKey else { return nil } |
Comment on lines
222
to
228
| @objc private func keyboardShortcutEventDidArrive(_ notification: Notification) { | ||
| guard let box = notification.object as? KeyboardShortcutEventBox else { return } | ||
| if shouldArmReleaseSuppression(for: box.event) { | ||
| suppressReleaseUntil = ProcessInfo.processInfo.systemUptime + releaseSuppressionTimeout | ||
| } | ||
| overlayCoordinator.show(box.event) | ||
| } |
Comment on lines
+44
to
45
| private let releaseSuppressionTimeout: TimeInterval = 10 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a configurable screenshot shortcut guard so ClickLight skips one mouse-up release highlight after the screenshot selection shortcut. Defaults to Command + Shift + 4 without registering or taking over the macOS shortcut.\n\nValidated with swift build and ./build-app.sh, then installed the local test build.