Allow user to configure push-to-talk shortcut from panel#16
Open
vikvang wants to merge 1 commit intofarzaa:mainfrom
Open
Allow user to configure push-to-talk shortcut from panel#16vikvang wants to merge 1 commit intofarzaa:mainfrom
vikvang wants to merge 1 commit intofarzaa:mainfrom
Conversation
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>
|
Pulled this in, switching to Shift+Fn worked well for me. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ShortcutOptionaString-backed,CaseIterableenum so it can be persisted to UserDefaults and iterated in the pickerpickerLabelproperty for human-readable display in the dropdowncurrentShortcutOptionfrom a staticletto a computed property that reads the user's preference from UserDefaults (defaulting to Ctrl+Option)pushToTalkDisplayTextandpushToTalkTooltipTextcomputed so they reflect the current shortcutCompanionManager.swift
selectedPushToTalkModifierCombinationpublished property backed by UserDefaultssetSelectedPushToTalkModifierCombination()setter that persists the choice and resets the monitor's pressed stateCompanionPanelView.swift
GlobalPushToTalkShortcutMonitor.swift
resetShortcutPressedState()to prevent the old shortcut from getting stuck in a pressed state when the user switches combinationsHow 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