Skip to content

fix(hotkeys): support F13–F20 and the native Mac Dictation key - #1040

Merged
H-Chris233 merged 4 commits into
Open-Less:betafrom
Eclock2000:fix/macos-dictation-function-keys
Sep 9, 2026
Merged

fix(hotkeys): support F13–F20 and the native Mac Dictation key#1040
H-Chris233 merged 4 commits into
Open-Less:betafrom
Eclock2000:fix/macos-dictation-function-keys

Conversation

@Eclock2000

@Eclock2000 Eclock2000 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Support F13–F20 and add the native Mac microphone/Dictation key to the existing dictation shortcut menu. Selecting it replaces the current binding; there is still one dictation trigger.

Changes

  • Accept F13–F20 in shared validation, platform key mappings, and frontend capture, including WebKit private-use function-key characters.
  • On macOS, route native Dictation-key press/release events into the existing recording modes. Consume only an unmodified native press and its paired repeats/release. Ordinary F5, F20, and modified native presses pass through; capture does not begin during Secure Event Input.
  • Register the selected key through the existing settings transaction. Failed registration retains the previous binding and displays an error. Switching away or quitting releases native interception.
  • Preserve the existing side-aware event channel during failed-switch rollback.

The native option requires a compatible Mac keyboard and Accessibility permission. There is no setup wizard, extra trigger, saved fallback binding, status polling, or dedicated retry UI. The shared preference schema and hotkey event loops are unchanged.

Validation

  • TypeScript/Vite production build and frontend recorder tests passed.
  • 36 exact-source Rust harness tests passed for key parsing, native-key state transitions, and side-aware routing, including failed-switch restoration.
  • 11 Core settings transaction tests passed, covering runtime and persistence failures.
  • Final macOS arm64 application build and ad hoc signature verification passed (npm run tauri -- build --bundles app; codesign --verify --deep --strict).
  • Earlier stable-backport hardware checks confirmed F20 through a remap and native keycode 176 interception without opening macOS Dictation; Fn+F5 remained ordinary F5.

Integrated beta recording/text insertion, restart behavior, and Windows hardware behavior have not been manually verified. These limitations are disclosed for review; the earlier hardware checks are not full beta application acceptance.

@Eclock2000 Eclock2000 changed the title fix(hotkeys): 支持专用 F20 与 Mac 原生听写键 fix(hotkeys): support F13–F20 and the native Mac Dictation key Sep 8, 2026
@Eclock2000
Eclock2000 marked this pull request as ready for review September 8, 2026 01:01
@Eclock2000
Eclock2000 marked this pull request as draft September 8, 2026 01:03
@H-Chris233
H-Chris233 marked this pull request as ready for review September 9, 2026 05:01

@H-Chris233 H-Chris233 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

首轮静态审核,基于 4a7c715

已检查扩展功能键校验和平台映射、Mac 原生键事件状态机、设置事务切换以及侧向修饰键监听器回滚路径
保留原绑定直到替代注册成功,以及回滚时复用 side-aware sender,是这次改动中需要继续保留的行为

当前不能给出合并批准
该提交关联 CI run 34183009905 的 conclusion 为 action_required,查询返回 jobs 为空,不能把 PR 描述中的本地验证当作当前 GitHub CI 已通过

合并前建议补充三组验证

• 在集成后的 beta 应用内验证按住、切换式录音、文本插入和重启后的持久化绑定,同时覆盖普通 F5、F20、Fn 组合键及 Secure Event Input
• 针对 native → 普通组合键、侧向组合键 → native 的注册失败与配置持久化失败,验证旧监听器仍能实际发出 press/release,而不仅是偏好值回滚
• macos_dictation_key.rs 的 callback 收到 event-tap-disabled 后发送 Released、设置 stop=true 并只写日志,请补充该路径的应用级测试,尤其是切换式录音已经开始时能否结束,以及用户如何发现监听器失效并重新启用,不能仅验证 KeyState

还需补充 Windows 实际键盘的 F13 至 F20 验证
以上是首轮审查与待验证事项,没有声称完成真机复现,也没有运行本地完整构建

@Open-Less Open-Less deleted a comment from chatgpt-codex-connector Bot Sep 9, 2026
@H-Chris233
H-Chris233 merged commit 7584091 into Open-Less:beta Sep 9, 2026
4 checks passed
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