Shortcut recorder rejects ⌘⇧ with a digit or symbol (e.g. ⌘⇧4)

已關閉 適合新手
#3,634 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

已經有一個關聯 PR 被合併了。

  • #3635 來自 @HlaKarki —— 已合併

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
72/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
macos, rust, tauri
領域
desktop, devtools

研究方向

問題出在快捷鍵錄製器的按鍵對應上:hotkey_code_for_key 沒有 $ 這類按 Shift 輸入的符號條目,因此 shortcuts_capture_key 對 ⌘⇧4 回傳 unsupported_key。請先閱讀 hotkey_code_for_key 以及接收 cmd-$ 的擷取路徑,然後決定帶 Shift 的數字和符號應如何對應到實體鍵碼。完成標準是:⌘⇧4 和 ⌘⇧/ 都能成功錄製,並且透過測試或人工檢查確認儲存的快捷鍵與實體按鍵一致。

由索引模型根據 Issue 內容生成。

描述

Description

Recording ⌘⇧4 for "Screenshot an area" shows "That key can't be used in a shortcut. Try a letter, number or F-key." The same happens for ⌘⇧ with any digit or punctuation key, like ⌘⇧1 or ⌘⇧/. ⌘⇧ with a letter records fine.

The macOS screenshot shortcuts are turned off on this Mac, and the other screenshot apps here (Shottr, CleanShot X) don't bind ⌘⇧4.

On macOS, gpui reports a shifted digit or symbol as the character it types and clears Shift, so ⌘⇧4 reaches shortcuts_capture_key as cmd-$. hotkey_code_for_key has no entry for $, so the recorder shows unsupported_key. The Tauri app stored e.code and e.shiftKey, so ⌘⇧4 recorded there.

Reproduction
  1. Open Settings → Shortcuts → Screenshot an area → Record shortcut.
  2. Press ⌘⇧4.
Additional Context
  • Cap version: 0.6.2
  • Operating system, version: macOS 27.0
  • Device (optional): Apple Silicon
Cap shortcut recorder showing the unsupported key error after pressing ⌘⇧4
主要語言
Rust
星號
24.2k
分支
2.2k
平均合併
1 天 10 小時
30 天內合併 PR
684

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CapSoftware/Cap 的其他 Issue

查看 CapSoftware/Cap 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。