Skip to content

Add screenshot release suppression#81

Merged
aurorascharff merged 1 commit into
mainfrom
codex/screenshot-release-suppression
Jul 6, 2026
Merged

Add screenshot release suppression#81
aurorascharff merged 1 commit into
mainfrom
codex/screenshot-release-suppression

Conversation

@aurorascharff

Copy link
Copy Markdown
Owner

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.

Copilot AI review requested due to automatic review settings July 6, 2026 06:56
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
click-light Ready Ready Preview, Comment Jul 6, 2026 6:56am

@aurorascharff aurorascharff merged commit 25daba6 into main Jul 6, 2026
6 checks passed
@aurorascharff aurorascharff deleted the codex/screenshot-release-suppression branch July 6, 2026 06:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 via SettingsStore, 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 binding to KeyboardShortcutEvent for 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants