Skip to content

feat(settings): an app-exception list that leaves programs' own keys alone - #116

Open
istoolsfox wants to merge 1 commit into
darrenprx:mainfrom
istoolsfox:feat/app-exceptions
Open

istoolsfox wants to merge 1 commit into
darrenprx:mainfrom
istoolsfox:feat/app-exceptions

Conversation

@istoolsfox

@istoolsfox istoolsfox commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #104

What and why

Issue #104: in Photoshop the Option + click that inspects layers is also lolPing's ping trigger, and the only way out was turning lolPing off. This adds an app-exception list (Settings → Trigger → 程序例外 / App exceptions): in the apps you name, lolPing stands down entirely — the ping and emote trigger keys, custom ones included, pass through, so the program's own shortcuts keep working. Gestures stay off there too; only the toggle hotkey still answers.

How it works for the user: pick a running app from the dropdown (with its icon; the list updates as apps come and go), press capture foreground (the window hides for 3 s and adds whatever the user switched to), or just type a process name. At most 32 entries, and the list lives in skipApps (normalizeSettings defaults it to [], so old settings files read as before).

Under the hood: config gains skipApps; the helper checks the foreground app per platform — GetForegroundWindow + QueryFullProcessImageName on Windows (cached per window, so a press costs one query) and NSWorkspace's frontmost application on macOS (hooks_mac.cpp now compiles as Objective-C++). A hit costs nothing when the list is empty. The helper's ready version becomes 5. Linux has no list yet: its helper never skips.

针对 #104:Photoshop 里 Option+单击查图层会和信号触发键打架,现在可以把 Photoshop 加进「程序例外」——在这些程序里 lolPing 完全让位(触发键、自定义触发键、手势都放行,程序自己的快捷键一切照常),总开关快捷键仍可用。支持从下拉框选正在运行的程序(带图标)、捕获前台程序(窗口隐藏 3 秒)、手输名字三种添加方式,最多 32 条,旧配置文件完全兼容。

How I tested it

npm run typecheck   # clean
npm run test:helper # 553 passed, 0 failed; 20 passed (macOS callback)
npm test            # 67 files, 1060 passed | 1 skipped

New suites cover the helper's list command and macOS app scan, the icon fetching, the settings normalization (invalid entries dropped, cap enforced, old files default to an empty list) and the trigger pass-through in the input bridge.

Ran by hand on:

  • Windows 11
  • macOS (Apple Silicon) — packaged build: Photoshop added via capture; Option + drag no longer opens the wheel while PS's own Option shortcuts work; removing the entry restores the trigger; the dropdown lists running apps with their real icons; a typed display name resolves to the process name.

The app-exception card in Settings → Trigger

Checklist

  • npm run typecheck, npm run test:helper and npm test pass
  • New logic has tests (helper app list, appIcons, settings normalization, input-bridge pass-through)
  • User-facing text is in both English and Chinese (src/shared/i18n.ts, both READMEs)
  • docs/design.md is updated (helper §App exceptions, trigger pass-through, ready version 5)
  • Screenshot attached (above)
  • AI tool had AGENTS.md in context and I read the whole diff. Tool: ZCode (GLM)

@istoolsfox
istoolsfox marked this pull request as ready for review October 19, 2026 09:33
…alone

Rebased onto v0.6.0: the helper protocol gains version 7 on top of the
teammate's 6 (the skipApps config field, the foregroundApp and appList
events and the getForegroundApp and getAppList commands).
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.

希望加入程序例外。

1 participant