Skip to content

Allow user to configure push-to-talk shortcut from panel#16

Open
vikvang wants to merge 1 commit intofarzaa:mainfrom
vikvang:feature/configurable-ptt-shortcut
Open

Allow user to configure push-to-talk shortcut from panel#16
vikvang wants to merge 1 commit intofarzaa:mainfrom
vikvang:feature/configurable-ptt-shortcut

Conversation

@vikvang
Copy link
Copy Markdown

@vikvang vikvang commented Apr 8, 2026

Summary

The push-to-talk keyboard shortcut was hardcoded to Ctrl+Option. Users may prefer a different modifier combination to avoid conflicts with other apps or match their muscle memory. This PR makes it user-configurable via a dropdown picker in the companion panel.

Changes

BuddyDictationManager.swift

  • Made ShortcutOption a String-backed, CaseIterable enum so it can be persisted to UserDefaults and iterated in the picker
  • Added pickerLabel property for human-readable display in the dropdown
  • Changed currentShortcutOption from a static let to a computed property that reads the user's preference from UserDefaults (defaulting to Ctrl+Option)
  • Made pushToTalkDisplayText and pushToTalkTooltipText computed so they reflect the current shortcut

CompanionManager.swift

  • Added selectedPushToTalkModifierCombination published property backed by UserDefaults
  • Added setSelectedPushToTalkModifierCombination() setter that persists the choice and resets the monitor's pressed state

CompanionPanelView.swift

  • Added a shortcut picker dropdown (styled to match the existing model picker) that appears when onboarding is complete and all permissions are granted
  • Updated instruction text ("Hold X to talk") to dynamically reflect the selected shortcut

GlobalPushToTalkShortcutMonitor.swift

  • Added resetShortcutPressedState() to prevent the old shortcut from getting stuck in a pressed state when the user switches combinations

How it works

The shortcut takes effect immediately — no app restart needed. Each CGEvent tap callback reads currentShortcutOption (which reads from UserDefaults), so changing the preference is picked up on the next keypress automatically.

Co-Authored-By: Oz oz-agent@warp.dev

The push-to-talk keyboard shortcut was hardcoded to Ctrl+Option. Users may
prefer a different modifier combination to avoid conflicts with other apps
or match their muscle memory.

- Make ShortcutOption String-backed and CaseIterable so choices can be
  persisted to UserDefaults and enumerated in the picker UI
- Change currentShortcutOption from a static let to a computed property
  that reads the user's preference (defaulting to Ctrl+Option)
- Add a dropdown shortcut picker to the companion panel, styled to match
  the existing model picker
- Update the instruction text to reflect the currently selected shortcut
- Reset the monitor's pressed state on shortcut change to prevent the old
  combo from getting stuck in a pressed state

Co-Authored-By: Oz <oz-agent@warp.dev>
@Ambisphaeric
Copy link
Copy Markdown

Pulled this in, switching to Shift+Fn worked well for me.

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