feat(whispering): global hotkey passthrough#1673
Open
YazzinDev wants to merge 5 commits into
Open
Conversation
…ey passthrough Introduces Tauri commands simulate_accelerator and get_is_simulating to support global shortcut passthrough. Adds an is_simulating atomic flag to the application state to prevent Whispering from intercepting its own simulated keyboard events.
Enables global shortcuts to propagate to other applications by implementing a re-play mechanism. Added a global shortcuts.global.passthrough setting and updated the service layer to unregister, simulate, and re-register hotkeys when passthrough is enabled.
Exposes the global shortcut passthrough feature on the Global Shortcuts settings page. Uses standard Field components for a consistent, high-quality interface and ensures all shortcuts are synchronized immediately when the setting is toggled.
…ough Provides a comprehensive technical specification and unit tests for the global shortcut registration logic. Includes tsconfig path aliases to support test module resolution within the whispering app.
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.
feat(whispering): add global hotkey passthrough
Introduce a global shortcut passthrough mechanism that re-emits hotkeys so other applications can receive them simultaneously.
Previously, global shortcuts in Whispering were exclusive and "consuming," meaning they prevented the keyboard event from propagating to the rest of the OS. This PR adds the ability for Whispering to "re-play" these shortcuts, allowing users to use the same hotkey for both Whispering and other applications (e.g., muting Discord or OBS while starting a recording).
Technical Implementation
We implemented a robust "Unregister -> Simulate -> Re-register" loop to work around OS-level hotkey exclusivity.
1. Rust Backend (Simulation & Tracking)
Added a
simulate_acceleratorTauri command that uses theenigocrate to replay the key combination. To prevent Whispering from intercepting its own simulated events (which would cause an infinite loop), we added anis_simulatingatomic flag to the app state.2. Service Layer (The Replay Loop)
The
GlobalShortcutManagernow manages the lifecycle of the passthrough event. When a shortcut is triggered and passthrough is enabled, it follows this sequence:3. User Interface
Added a centralized "Global Passthrough" setting to the Global Shortcuts settings page. This provides a single toggle for users who want their system-wide shortcuts to be non-consuming.
Changelog
Closes #