uttrflow / uttrflow/uttrflow-swift

Settings draws some real keys as "Key 10", "Key 93" and so on instead of their names

Open Beginner friendly
#496 0 comments 0 reactions 0 assignees View on GitHub
area:dictation bug good first issue P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## What happens

`SettingsShortcut.name(of:)` (`Sources/UttrflowUX/SettingsShortcut.swift:45`) falls back to `"Key \(keyCode)"` for any code missing from `keyNames` (lines 52-74). These key codes from real keyboards are missing:

| code | key |
|---|---|
| 10 | Section key on ISO keyboards (`§`) |
| 72, 73, 74 | Volume Up, Volume Down, Mute |
| 93 | Yen on JIS keyboards (`¥`) |
| 94 | Underscore on JIS keyboards (`_`) |
| 95 | Keypad comma on JIS keyboards |
| 102 | Eisu on JIS keyboards (`英数`) |
| 104 | Kana on JIS keyboards (`かな`) |
| 110 | the context-menu key on some external keyboards |

All of these are at or below `HotkeyBinding.highestKeyCode` (`Sources/UttrflowCore/Protocols/HotkeyMonitoring.swift:82`) and are not modifiers, so `isDeliverable` accepts a shortcut on them and Settings then shows it as a bare number.

## Why it matters

Someone on a JIS or ISO keyboard who records a shortcut on one of these keys sees "Key 93" and cannot tell whether the recording worked.

## How to check

`SettingsShortcut.name(of: 93)` returns `"Key 93"`. The remaining unnamed codes can be listed by comparing `keyNames` against `0...127`.

## Acceptance criteria

- Codes 10, 72-74, 93, 94, 95, 102, 104 and 110 have names or symbols consistent with the existing table (for example `§`, `¥`, `英数`, `かな`).
- A parameterised test in `SettingsShortcutTests.swift` checks each, in the style of `namesEveryHeldModifier` (around line 81).
- The existing fallback test for an unknown code (`namesTheUnnameable`, code 200) still passes.

## Where to start

- `Sources/UttrflowUX/SettingsShortcut.swift:45-74`
- Tests to extend: `Tests/UttrflowUXTests/SettingsShortcutTests.swift`.
- Before pushing, run `make verify` (export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer first). It is the same command CI runs, and it enforces the 95% coverage floor per module.
- Read [CONTRIBUTING.md](https://github.com/uttrflow/uttrflow-swift/blob/main/CONTRIBUTING.md) first, and say on this issue that you are taking it.

**Size:** S, about 1-2 hours.

Contributor guide

Open the contributing guide

Research direction

Read CONTRIBUTING.md, then inspect Sources/UttrflowUX/SettingsShortcut.swift:45-74 and the existing tests in Tests/UttrflowUXTests/SettingsShortcutTests.swift. Add names for the listed key codes consistent with the existing table, and extend the parameterized test in the style of namesEveryHeldModifier. Run make verify with the specified DEVELOPER_DIR and confirm namesTheUnnameable for code 200 still passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.