A free, open source, and extensible speech-to-text application that works completely offline.
auto push to talk mode (#1971)
CJ Paisc62a5fcdef41
diff --git a/README.md b/README.mdindex c221a0a6..0224e2f0 100644--- a/README.md+++ b/README.md@@ -19,7 +19,7 @@ Handy isn't trying to be the best speech-to-text app—it's trying to be the mos## How It Works-1. **Press** a configurable keyboard shortcut to start/stop recording (or use push-to-talk mode)+1. **Press** a configurable keyboard shortcut: hold it to record and release to stop, or tap it to toggle recording on and off (Hold-only and Toggle-only modes are also available)2. **Speak** your words while the shortcut is active3. **Release** and Handy processes your speech using Whisper4. **Get** your transcribed text pasted directly into whatever app you're usingdiff --git a/public/release-notes/0.9.7/shortcut-behavior.png b/public/release-notes/0.9.7/shortcut-behavior.pngnew file mode 100644index 00000000..7e1cdaafBinary files /dev/null and b/public/release-notes/0.9.7/shortcut-behavior.png differdiff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rsindex c8bbf1dc..2a1933a3 100644--- a/src-tauri/src/lib.rs+++ b/src-tauri/src/lib.rs@@ -617,7 +617,8 @@ pub fn run(cli_args: CliArgs) {.commands(collect_commands![shortcut::change_binding,shortcut::reset_binding,- shortcut::change_ptt_setting,+ shortcut::change_shortcut_activation_setting,+ shortcut::change_hold_threshold_ms_setting,shortcut::change_audio_feedback_setting,shortcut::change_audio_feedback_volume_setting,shortcut::change_sound_theme_setting,diff --git a/src-tauri/src/settings.rs b/src-tauri/src/settings.rsindex 8e50fbd9..44363d49 100644--- a/src-tauri/src/settings.rs+++ b/src-tauri/src/settings.rs@@ -156,6 +156,21 @@ pub enum PasteMethod {ExternalScript,}+/// How the transcribe shortcut's key events drive a recording.+#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Type, Default)]+#[serde(rename_all = "snake_case")]+pub enum ShortcutActivation {+ /// Press to start, press again to stop.+ Toggle,+ /// Hold to record, release to stop.+ PushToTalk,+ /// Hold to record and release to stop, or tap to keep recording until the+ /// next press. Which one it was is decided by how long the key was held+ /// (`hold_threshold_ms`).+ #[default]+ HoldOrToggle,+}+#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Type, Default)]#[serde(rename_all = "snake_case")]pub enum ClipboardHandling {@@ -356,8 +371,14 @@ pub struct AppSettings {/// default bindings for any missing keys before the settings are used.#[serde(default)]pub bindings: HashMap<String, ShortcutBinding>,- #[serde(default = "default_push_to_talk")]- pub push_to_talk: bool,+ /// Replaces the pre-0.10 `push_to_talk` bool; stores missing this key are+ /// migrated from it in `apply_settings_migrations`.+ #[serde(default)]+ pub shortcut_activation: ShortcutActivation,+ /// Hold-or-toggle only: a press held at least this long is push-to-talk,+ /// anything shorter is a tap that locks recording on.+ #[serde(default = "default_hold_threshold_ms")]+ pub hold_threshold_ms: u64,#[serde(default)]pub audio_feedback: bool,#[serde(default = "default_audio_feedback_volume")]@@ -505,8 +526,8 @@ fn default_settings_schema_version() -> u32 {CURRENT_SETTINGS_SCHEMA_VERSION}-fn default_push_to_talk() -> bool {- true+fn default_hold_threshold_ms() -> u64 {+ 300}fn default_always_on_microphone() -> bool {@@ -889,7 +910,8 @@ pub fn get_default_settings() -> AppSettings {AppSettings {settings_schema_version: default_settings_schema_version(),bindings,- push_to_talk: default_push_to_talk(),+ shortcut_activation: ShortcutActivation::default(),+ hold_threshold_ms: default_hold_threshold_ms(),audio_feedback: false,audio_feedback_volume: default_audio_feedback_volume(),sound_theme: default_sound_theme(),@@ -1099,6 +1121,21 @@ fn apply_settings_migrations(updated = true;}+ // One-time shortcut activation migration (only while the new key is+ // absent): the retired `push_to_talk` bool maps onto the two legacy modes so+ // upgrading users keep exactly the behavior they had. Only fresh installs+ // get the hold-or-toggle default.+ if settings_value.get("shortcut_activation").is_none() {+ if let Some(push_to_talk) = settings_value.get("push_to_talk").and_then(|v| v.as_bool()) {+ settings.shortcut_activation = if push_to_talk {+ ShortcutActivation::PushToTalk+ } else {+ ShortcutActivation::Toggle+ };+ updated = true;+ }+ }+let stored_schema_version = settings_value.get("settings_schema_version").and_then(|v| v.as_u64())@@ -1215,7 +1252,11 @@ mod tests {fn empty_store_parses_with_defaults() {let settings: AppSettings = serde_json::from_value(serde_json::json!({})).expect("all AppSettings fields need serde defaults");- assert!(settings.push_to_talk);+ assert_eq!(+ settings.shortcut_activation,+ ShortcutActivation::HoldOrToggle+ );+ assert_eq!(settings.hold_threshold_ms, default_hold_threshold_ms());assert!(!settings.audio_feedback);assert!(settings.filler_word_removal_enabled);// Bindings default to empty; the load path merges the real defaults in.@@ -1350,6 +1391,9 @@ mod tests {settings.transcribe_accelerator,TranscribeAcceleratorSetting::Auto);+ // The retired push_to_talk bool (false in this fixture) becomes the+ // matching legacy mode rather than the new hold-or-toggle default.+ assert_eq!(settings.shortcut_activation, ShortcutActivation::Toggle);assert_eq!(settings.transcribe_gpu_device, None);}@@ -1507,6 +1551,59 @@ mod tests {assert_eq!(settings.overlay_position, OverlayPosition::Top);}+ #[test]+ fn shortcut_activation_migration_maps_push_to_talk_true() {+ let mut settings = get_default_settings();+ let raw = serde_json::json!({+ "selected_model": "",+ "push_to_talk": true+ });++ assert!(apply_settings_migrations(&mut settings, &raw));+ assert_eq!(settings.shortcut_activation, ShortcutActivation::PushToTalk);+ }++ #[test]+ fn shortcut_activation_migration_maps_push_to_talk_false() {+ let mut settings = get_default_settings();+ let raw = serde_json::json!({+ "selected_model": "",+ "push_to_talk": false+ });++ assert!(apply_settings_migrations(&mut settings, &raw));+ assert_eq!(settings.shortcut_activation, ShortcutActivation::Toggle);+ }++ #[test]+ fn shortcut_activation_migration_respects_explicit_new_key() {+ let mut settings = get_default_settings();+ settings.shortcut_activation = ShortcutActivation::HoldOrToggle;+ let raw = serde_json::json!({+ "selected_model": "",+ "push_to_talk": true,+ "shortcut_activation": "hold_or_toggle"+ });++ apply_settings_migrations(&mut settings, &raw);+ assert_eq!(+ settings.shortcut_activation,+ ShortcutActivation::HoldOrToggle+ );+ }++ #[test]+ fn shortcut_activation_defaults_to_hold_or_toggle_without_legacy_key() {+ let mut settings = get_default_settings();+ let raw = serde_json::json!({ "selected_model": "" });++ apply_settings_migrations(&mut settings, &raw);+ assert_eq!(+ settings.shortcut_activation,+ ShortcutActivation::HoldOrToggle+ );+ }+#[test]fn gpu_device_migration_resets_legacy_positive_selection_to_auto() {let mut settings = get_default_settings();diff --git a/src-tauri/src/shortcut/handler.rs b/src-tauri/src/shortcut/handler.rsindex c0ab7f35..3365b3fb 100644--- a/src-tauri/src/shortcut/handler.rs+++ b/src-tauri/src/shortcut/handler.rs@@ -18,8 +18,8 @@ use crate::TranscriptionCoordinator;/// This function contains the shared logic for:/// - Looking up the action in ACTION_MAP/// - Handling the cancel binding (only fires when recording)-/// - Handling push-to-talk mode (start on press, stop on release)-/// - Handling toggle mode (toggle state on press only)+/// - Routing transcribe bindings to the coordinator, which applies the+/// configured activation mode (toggle / push-to-talk / hold-or-toggle)////// # Arguments/// * `app` - The Tauri app handle@@ -37,7 +37,13 @@ pub fn handle_shortcut_event(// Transcribe bindings are handled by the coordinator.if is_transcribe_binding(binding_id) {if let Some(coordinator) = app.try_state::<TranscriptionCoordinator>() {- coordinator.send_input(binding_id, hotkey_string, is_pressed, settings.push_to_talk);+ coordinator.send_input(+ binding_id,+ hotkey_string,+ is_pressed,+ settings.shortcut_activation,+ std::time::Duration::from_millis(settings.hold_threshold_ms),+ );} else {warn!("TranscriptionCoordinator is not initialized");}diff --git a/src-tauri/src/shortcut/mod.rs b/src-tauri/src/shortcut/mod.rsindex cb9ff4a4..8a603f4b 100644--- a/src-tauri/src/shortcut/mod.rs+++ b/src-tauri/src/shortcut/mod.rs@@ -22,8 +22,8 @@ use tauri::{AppHandle, Emitter, Manager};use crate::settings::APPLE_INTELLIGENCE_DEFAULT_MODEL_ID;use crate::settings::{self, get_settings, AutoSubmitKey, ClipboardHandling, KeyboardImplementation, LLMPrompt,- OverlayPosition, OverlayStyle, PasteMethod, ShortcutBinding, SoundTheme, Theme, TypingTool,- VadBackend, APPLE_INTELLIGENCE_PROVIDER_ID,+ OverlayPosition, OverlayStyle, PasteMethod, ShortcutActivation, ShortcutBinding, SoundTheme,+ Theme, TypingTool, VadBackend, APPLE_INTELLIGENCE_PROVIDER_ID,};use crate::tray;@@ -526,9 +526,21 @@ fn initialize_handy_keys_with_rollback(app: &AppHandle) -> Result<bool, String>#[tauri::command]#[specta::specta]-pub fn change_ptt_setting(app: AppHandle, enabled: bool) -> Result<(), String> {+pub fn change_shortcut_activation_setting(+ app: AppHandle,+ activation: ShortcutActivation,+) -> Result<(), String> {+ let mut settings = settings::get_settings(&app);+ settings.shortcut_activation = activation;+ settings::write_settings(&app, settings);+ Ok(())+}++#[tauri::command]+#[specta::specta]+pub fn change_hold_threshold_ms_setting(app: AppHandle, ms: u64) -> Result<(), String> {let mut settings = settings::get_settings(&app);- settings.push_to_talk = enabled;+ settings.hold_threshold_ms = ms;settings::write_settings(&app, settings);Ok(())}diff --git a/src-tauri/src/transcription_coordinator.rs b/src-tauri/src/transcription_coordinator.rsindex ec76f808..a35bff37 100644--- a/src-tauri/src/transcription_coordinator.rs+++ b/src-tauri/src/transcription_coordinator.rs@@ -1,5 +1,6 @@use crate::actions::ACTION_MAP;use crate::managers::audio::AudioRecordingManager;+use crate::settings::ShortcutActivation;use log::{debug, error, warn};use std::sync::mpsc::{self, Sender};use std::sync::Arc;@@ -17,10 +18,20 @@ enum PttAction {CancelRelease,}+/// A key-up deferred by `RELEASE_GRACE` so a synthesized X11 auto-repeat+/// press can cancel it (#1539). When the grace elapses the hold is resolved+/// by [`CoordinatorState::finish_hold`] (recording) or+/// [`CoordinatorState::finish_pending_hold`] (press remembered while busy).struct PendingRelease {binding_id: String,hotkey_string: String,deadline: Instant,+ /// When the key actually went up. The hold duration is measured to this+ /// instant, not to the grace expiry.+ released_at: Instant,+ /// Holds at least this long stop recording; shorter ones lock it on.+ /// Push-to-talk passes zero so every release stops.+ hold_threshold: Duration,}/// A press that arrived while the pipeline was still busy processing the@@ -30,36 +41,81 @@ struct PendingRelease {struct PendingPress {binding_id: String,hotkey_string: String,+ /// The real key-down time, so a hold that straddles the drain is still+ /// measured from when the user pressed, not from when recording began.+ pressed_at: Instant,+ /// The recording will start locked on when the pipeline drains: set from+ /// the start for toggle, and for hold-or-toggle once the key came back up+ /// within the threshold (a tap). An unlocked pending press is a key we+ /// believe is still held.+ locked: bool,+}++impl PendingPress {+ fn remembered(&self) -> Remembered {+ if self.locked {+ Remembered::Locked+ } else {+ Remembered::Held+ }+ }+}++/// What kind of press is already waiting for the pipeline to drain.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+enum Remembered {+ /// The key is still down as far as we know.+ Held,+ /// A toggle press or a classified tap: it will start a locked session.+ Locked,+}++/// Bookkeeping for the key press that started the current recording.+struct Hold {+ pressed_at: Instant,+ /// Recording outlives the key: the next press stops it, releases are+ /// ignored. Always set for toggle; set for hold-or-toggle once a release+ /// has been classified as a tap.+ locked: bool,}/// What to do with an input that arrives while the pipeline is busy-/// (`Stage::Processing`). `remembered` is whether a press for the same binding-/// is already waiting for the pipeline to drain.+/// (`Stage::Processing`). `remembered` is the press for the same binding+/// already waiting for the pipeline to drain, if any.#[derive(Debug, Clone, Copy, PartialEq, Eq)]enum BusyAction {/// Ignore the input entirely.Ignore,/// Remember the press; start recording when the pipeline finishes.Remember,- /// This input cancels a previously remembered press (toggle parity: two- /// presses during one busy window net to no-op; PTT: the key was already- /// released, so the remembered press must not fire).+ /// This press cancels a previously remembered press: two presses during+ /// one busy window net to no-op, exactly as a press stops a locked+ /// session once recording.Forget,}-fn classify_busy_input(is_pressed: bool, push_to_talk: bool, remembered: bool) -> BusyAction {- match (push_to_talk, is_pressed) {+fn classify_busy_input(+ is_pressed: bool,+ mode: ShortcutActivation,+ remembered: Option<Remembered>,+) -> BusyAction {+ use ShortcutActivation::*;+ match (mode, is_pressed, remembered) {// Toggle: presses alternate remember/forget to preserve parity.- (false, true) if remembered => BusyAction::Forget,- (false, true) => BusyAction::Remember,+ (Toggle, true, Some(_)) => BusyAction::Forget,+ (Toggle, true, None) => BusyAction::Remember,// Toggle mode ignores releases.- (false, false) => BusyAction::Ignore,- // PTT: a press while busy means the user is holding the key — start as- // soon as the pipeline drains. A release while busy means the tap is- // already over; forget the remembered press (or ignore if none).- (true, true) => BusyAction::Remember,- (true, false) if remembered => BusyAction::Forget,- (true, false) => BusyAction::Ignore,+ (Toggle, false, _) => BusyAction::Ignore,+ // Hold modes: a press while busy means the user is holding the key —+ // start as soon as the pipeline drains. A press on a queued tap stops+ // it (parity); a press while the key is already down is a repeat.+ (PushToTalk | HoldOrToggle, true, None) => BusyAction::Remember,+ (PushToTalk | HoldOrToggle, true, Some(Remembered::Locked)) => BusyAction::Forget,+ (PushToTalk | HoldOrToggle, true, Some(Remembered::Held)) => BusyAction::Ignore,+ // Releases of a held pending press are deferred by the grace window+ // before reaching here and resolved by `finish_pending_hold`; any+ // other release (no press remembered, or already locked) is noise.+ (PushToTalk | HoldOrToggle, false, _) => BusyAction::Ignore,}}@@ -76,13 +132,26 @@ struct InputEvent {binding_id: String,hotkey_string: String,is_pressed: bool,- push_to_talk: bool,+ mode: ShortcutActivation,+ /// Hold-or-toggle: minimum press duration that counts as a hold.+ hold_threshold: Duration,/// External triggers (SIGUSR2, CLI flags) rather than physical keys./// They fire on every edge by design and must never be debounced —/// dropping one desyncs toggle parity and wedges recording on.external: bool,}+impl InputEvent {+ /// The hold duration at or above which a release stops recording.+ fn effective_hold_threshold(&self) -> Duration {+ match self.mode {+ ShortcutActivation::HoldOrToggle => self.hold_threshold,+ // Every release stops; toggle never defers releases at all.+ ShortcutActivation::PushToTalk | ShortcutActivation::Toggle => Duration::ZERO,+ }+ }+}+/// A side effect decided by [`CoordinatorState`]; the coordinator thread is/// the only executor. Keeping decisions pure lets tests drive the exact/// production transitions without a Tauri `AppHandle` or real timers.@@ -105,14 +174,20 @@ enum Command {ProcessingFinished,}+/// Decide whether a key-up should be deferred (so auto-repeat can cancel it)+/// or a key-down cancels a deferred release. `hold_to_talk` is whether a+/// release currently ends the session: true for push-to-talk and for an+/// unlocked hold-or-toggle session, false for toggle and a locked session.+/// `held_binding` is the binding whose key we believe is down — the one+/// recording, or the one remembered while the pipeline is busy.fn classify_ptt_event(pending_release_binding: Option<&str>,is_pressed: bool,- push_to_talk: bool,+ hold_to_talk: bool,binding_id: &str,- recording_binding: Option<&str>,+ held_binding: Option<&str>,) -> PttAction {- if !push_to_talk {+ if !hold_to_talk {return PttAction::Passthrough;}@@ -122,19 +197,28 @@ fn classify_ptt_event(} else {PttAction::Passthrough}- } else if recording_binding == Some(binding_id) && pending_release_binding.is_none() {+ } else if held_binding == Some(binding_id) && pending_release_binding.is_none() {PttAction::DeferRelease} else {PttAction::Passthrough}}-/// Pure lifecycle state machine: owns every transition decision (PTT grace,-/// debounce, busy-pipeline remember/forget, cancel, drain). Produces-/// [`Effect`]s instead of touching the app, so unit tests exercise the real-/// production logic.+/// Pure lifecycle state machine: owns every transition decision (release+/// grace, hold-vs-tap classification, debounce, busy-pipeline+/// remember/forget, cancel, drain). Produces [`Effect`]s instead of touching+/// the app, so unit tests exercise the real production logic.+///+/// All three activation modes run through one machine. A recording starts on+/// key-down in every mode; what differs is how it ends:+///+/// * push-to-talk — every release stops (hold threshold of zero)+/// * toggle — releases are ignored, the next press stops (locked from the start)+/// * hold-or-toggle — a release after a long hold stops; a release after a+/// short tap locks the session, and the next press stopsstruct CoordinatorState {stage: Stage,+ hold: Option<Hold>,last_press: Option<Instant>,pending_release: Option<PendingRelease>,pending_press: Option<PendingPress>,@@ -144,6 +228,7 @@ impl CoordinatorState {fn new() -> Self {Self {stage: Stage::Idle,+ hold: None,last_press: None,pending_release: None,pending_press: None,@@ -155,22 +240,31 @@ impl CoordinatorState {self.pending_release.as_ref().map(|p| p.deadline)}+ /// Whether the current session (recording, or remembered for the drain)+ /// outlives the key, so releases are ignored and the next press ends it.+ fn is_locked(&self) -> bool {+ self.hold.as_ref().is_some_and(|h| h.locked)+ || self.pending_press.as_ref().is_some_and(|p| p.locked)+ }+fn on_input(&mut self, input: InputEvent, now: Instant) -> Option<Effect> {let pending_release_binding = self.pending_release.as_ref().map(|pending| pending.binding_id.as_str());- let recording_binding = match &self.stage {+ let held_binding = match &self.stage {Stage::Recording(id) => Some(id.as_str()),- _ => None,+ Stage::Processing => self.pending_press.as_ref().map(|p| p.binding_id.as_str()),+ Stage::Idle => None,};+ let hold_to_talk = input.mode != ShortcutActivation::Toggle && !self.is_locked();match classify_ptt_event(pending_release_binding,input.is_pressed,- input.push_to_talk,+ hold_to_talk,&input.binding_id,- recording_binding,+ held_binding,) {PttAction::CancelRelease => {self.pending_release = None;@@ -178,9 +272,11 @@ impl CoordinatorState {}PttAction::DeferRelease => {self.pending_release = Some(PendingRelease {+ hold_threshold: input.effective_hold_threshold(),binding_id: input.binding_id,hotkey_string: input.hotkey_string,deadline: now + RELEASE_GRACE,+ released_at: now,});return None;}@@ -188,7 +284,7 @@ impl CoordinatorState {}// Debounce rapid-fire press events (key repeat / double-tap).- // Push-to-talk releases may be deferred above to absorb X11 auto-repeat.+ // Releases in the hold modes are deferred above to absorb X11 auto-repeat.// External triggers are exempt: each one is a deliberate edge from the// user's own integration, and dropping it desyncs toggle parity.if input.is_pressed && !input.external {@@ -219,16 +315,19 @@ impl CoordinatorState {return None;}}- let remembered = self.pending_press.is_some();- match classify_busy_input(input.is_pressed, input.push_to_talk, remembered) {+ let remembered = self.pending_press.as_ref().map(|p| p.remembered());+ match classify_busy_input(input.is_pressed, input.mode, remembered) {BusyAction::Remember => {debug!("Remembering press for '{}': pipeline busy",input.binding_id);self.pending_press = Some(PendingPress {+ // Toggle never ends on a release: locked from the start.+ locked: input.mode == ShortcutActivation::Toggle,binding_id: input.binding_id,hotkey_string: input.hotkey_string,+ pressed_at: now,});}BusyAction::Forget => {@@ -242,40 +341,121 @@ impl CoordinatorState {return None;}- if input.push_to_talk {- if input.is_pressed {- if matches!(self.stage, Stage::Idle) {- return Some(self.begin_recording(input.binding_id, input.hotkey_string));- }- } else if matches!(&self.stage, Stage::Recording(id) if id == &input.binding_id) {- return Some(self.begin_processing(input.binding_id, input.hotkey_string));- }- } else if input.is_pressed {+ if input.is_pressed {match &self.stage {Stage::Idle => {- return Some(self.begin_recording(input.binding_id, input.hotkey_string));+ // Toggle never ends on a release: locked from the start.+ let locked = input.mode == ShortcutActivation::Toggle;+ return Some(self.begin_recording(+ input.binding_id,+ input.hotkey_string,+ now,+ locked,+ ));}Stage::Recording(id) if id == &input.binding_id => {- return Some(self.begin_processing(input.binding_id, input.hotkey_string));+ // A locked session ends on the next press. In toggle mode+ // every press ends it, even if the recording began under a+ // hold mode (the setting changed mid-recording) — otherwise+ // nothing but Escape could stop it.+ if self.is_locked() || input.mode == ShortcutActivation::Toggle {+ return Some(self.begin_processing(input.binding_id, input.hotkey_string));+ }+ // The key is still held (its release will end this+ // recording), so a repeated press means nothing.+ debug!("Ignoring press for '{}': key is held", input.binding_id);}_ => debug!("Ignoring press for '{}': another binding is recording",input.binding_id),}+ } else if hold_to_talk+ && matches!(&self.stage, Stage::Recording(id) if id == &input.binding_id)+ {+ // A release that was not deferred (one is already pending for this+ // binding): resolve it immediately rather than dropping it.+ let threshold = input.effective_hold_threshold();+ return self.finish_hold(input.binding_id, input.hotkey_string, now, threshold);}None}/// The `RELEASE_GRACE` window elapsed with no cancelling press arriving:- /// fire the deferred release iff we are still recording that binding.+ /// resolve the deferred release against whatever that binding's key was+ /// holding — the live recording, or a press remembered while busy.fn on_grace_expired(&mut self) -> Option<Effect> {let pending = self.pending_release.take()?;- if matches!(&self.stage, Stage::Recording(id) if id == &pending.binding_id) {- Some(self.begin_processing(pending.binding_id, pending.hotkey_string))+ match &self.stage {+ Stage::Recording(id) if *id == pending.binding_id => self.finish_hold(+ pending.binding_id,+ pending.hotkey_string,+ pending.released_at,+ pending.hold_threshold,+ ),+ Stage::Processing => {+ self.finish_pending_hold(&pending);+ None+ }+ _ => None,+ }+ }++ /// A press remembered while the pipeline was busy has been released for+ /// real, still before the drain. A completed hold has nothing left to+ /// start; a tap queues a locked session so the drain starts it — the+ /// same hold-vs-tap rule as [`CoordinatorState::finish_hold`].+ fn finish_pending_hold(&mut self, release: &PendingRelease) {+ let Some(pending) = self+ .pending_press+ .as_mut()+ .filter(|p| p.binding_id == release.binding_id)+ else {+ return;+ };+ let held = release+ .released_at+ .saturating_duration_since(pending.pressed_at);+ if held < release.hold_threshold {+ debug!(+ "Tap ({held:?}) for '{}' while busy: will start locked on when the pipeline drains",+ release.binding_id+ );+ pending.locked = true;} else {- None+ debug!(+ "Forgetting remembered press for '{}': released after a {held:?} hold while busy",+ release.binding_id+ );+ self.pending_press = None;+ }+ }++ /// The key that started the current recording has been released for real.+ /// A hold at least `threshold` long stops recording; anything shorter was a+ /// tap, which locks the session on until the next press.+ fn finish_hold(+ &mut self,+ binding_id: String,+ hotkey_string: String,+ released_at: Instant,+ threshold: Duration,+ ) -> Option<Effect> {+ let held = self+ .hold+ .as_ref()+ .map(|h| released_at.saturating_duration_since(h.pressed_at))+ // No hold bookkeeping means we cannot tell a tap from a hold;+ // stopping is the safe reading (it is what push-to-talk always did).+ .unwrap_or(Duration::MAX);+ if held >= threshold {+ return Some(self.begin_processing(binding_id, hotkey_string));+ }+ if let Some(hold) = &mut self.hold {+ debug!("Tap ({held:?}) for '{binding_id}': recording locked on until the next press");+ hold.locked = true;}+ None}fn on_cancel(&mut self, recording_was_active: bool) {@@ -288,17 +468,24 @@ impl CoordinatorState {&& (recording_was_active || matches!(self.stage, Stage::Recording(_))){self.stage = Stage::Idle;+ self.hold = None;}}fn on_processing_finished(&mut self) -> Option<Effect> {self.stage = Stage::Idle;+ self.hold = None;let pending = self.pending_press.take()?;debug!("Pipeline drained; starting remembered press for '{}'",pending.binding_id);- Some(self.begin_recording(pending.binding_id, pending.hotkey_string))+ Some(self.begin_recording(+ pending.binding_id,+ pending.hotkey_string,+ pending.pressed_at,+ pending.locked,+ ))}/// Reconcile the optimistic `Stage::Recording` after the executor reports@@ -306,14 +493,22 @@ impl CoordinatorState {fn on_start_result(&mut self, binding_id: &str, started: bool) {if !started && matches!(&self.stage, Stage::Recording(id) if id == binding_id) {self.stage = Stage::Idle;+ self.hold = None;}}/// Optimistic transition to `Recording`; rolled back via/// [`CoordinatorState::on_start_result`] if the effect fails to start/// recording for real.- fn begin_recording(&mut self, binding_id: String, hotkey_string: String) -> Effect {+ fn begin_recording(+ &mut self,+ binding_id: String,+ hotkey_string: String,+ pressed_at: Instant,+ locked: bool,+ ) -> Effect {self.stage = Stage::Recording(binding_id.clone());+ self.hold = Some(Hold { pressed_at, locked });Effect::Start {binding_id,hotkey_string,@@ -322,6 +517,7 @@ impl CoordinatorState {fn begin_processing(&mut self, binding_id: String, hotkey_string: String) -> Effect {self.stage = Stage::Processing;+ self.hold = None;Effect::Stop {binding_id,hotkey_string,@@ -395,22 +591,37 @@ impl TranscriptionCoordinator {Self { tx }}- /// Send a keyboard/signal input event for a transcribe binding.- /// For signal-based toggles, use `is_pressed: true` and `push_to_talk: false`.+ /// Send a keyboard input event for a transcribe binding. `hold_threshold`+ /// only matters for [`ShortcutActivation::HoldOrToggle`].pub fn send_input(&self,binding_id: &str,hotkey_string: &str,is_pressed: bool,- push_to_talk: bool,+ mode: ShortcutActivation,+ hold_threshold: Duration,) {- self.send(binding_id, hotkey_string, is_pressed, push_to_talk, false);+ self.send(+ binding_id,+ hotkey_string,+ is_pressed,+ mode,+ hold_threshold,+ false,+ );}/// Send an external trigger (SIGUSR2, CLI flag). Always a toggle press,/// always exempt from debounce — see [`InputEvent::external`].pub fn send_external_input(&self, binding_id: &str, source: &str) {- self.send(binding_id, source, true, false, true);+ self.send(+ binding_id,+ source,+ true,+ ShortcutActivation::Toggle,+ Duration::ZERO,+ true,+ );}fn send(@@ -418,7 +629,8 @@ impl TranscriptionCoordinator {binding_id: &str,hotkey_string: &str,is_pressed: bool,- push_to_talk: bool,+ mode: ShortcutActivation,+ hold_threshold: Duration,external: bool,) {if self@@ -427,7 +639,8 @@ impl TranscriptionCoordinator {binding_id: binding_id.to_string(),hotkey_string: hotkey_string.to_string(),is_pressed,- push_to_talk,+ mode,+ hold_threshold,external,})).is_err()@@ -575,56 +788,67 @@ mod tests {#[test]fn toggle_press_during_processing_remembers_start() {assert_eq!(- classify_busy_input(true, false, false),+ classify_busy_input(true, ShortcutActivation::Toggle, None),BusyAction::Remember);}#[test]fn second_toggle_press_during_processing_forgets_press() {- assert_eq!(classify_busy_input(true, false, true), BusyAction::Forget);+ assert_eq!(+ classify_busy_input(true, ShortcutActivation::Toggle, Some(Remembered::Locked)),+ BusyAction::Forget+ );}#[test]fn toggle_release_during_processing_is_ignored() {- assert_eq!(classify_busy_input(false, false, false), BusyAction::Ignore);- assert_eq!(classify_busy_input(false, false, true), BusyAction::Ignore);- }-- #[test]- fn ptt_press_during_processing_remembers_start() {- assert_eq!(classify_busy_input(true, true, false), BusyAction::Remember);+ assert_eq!(+ classify_busy_input(false, ShortcutActivation::Toggle, None),+ BusyAction::Ignore+ );+ assert_eq!(+ classify_busy_input(false, ShortcutActivation::Toggle, Some(Remembered::Locked)),+ BusyAction::Ignore+ );}#[test]- fn ptt_release_during_processing_forgets_remembered_press() {- assert_eq!(classify_busy_input(false, true, true), BusyAction::Forget);- assert_eq!(classify_busy_input(false, true, false), BusyAction::Ignore);+ fn hold_modes_classify_busy_inputs_by_pending_state() {+ let cases = [+ (true, None, BusyAction::Remember),+ (true, Some(Remembered::Held), BusyAction::Ignore),+ (true, Some(Remembered::Locked), BusyAction::Forget),+ (false, None, BusyAction::Ignore),+ (false, Some(Remembered::Held), BusyAction::Ignore),+ (false, Some(Remembered::Locked), BusyAction::Ignore),+ ];++ for mode in [+ ShortcutActivation::PushToTalk,+ ShortcutActivation::HoldOrToggle,+ ] {+ for (is_pressed, remembered, expected) in cases {+ assert_eq!(classify_busy_input(is_pressed, mode, remembered), expected);+ }+ }}/// Toggle parity across a busy window: an odd number of presses remembers/// one start, each further press flips the remembered press off/on again.#[test]fn toggle_presses_alternate_remember_and_forget_while_busy() {- let mut remembered = false;+ let mut remembered = None;for expected in [BusyAction::Remember,BusyAction::Forget,BusyAction::Remember,] {- let action = classify_busy_input(true, false, remembered);+ let action = classify_busy_input(true, ShortcutActivation::Toggle, remembered);assert_eq!(action, expected);- remembered = action == BusyAction::Remember;+ remembered = (action == BusyAction::Remember).then_some(Remembered::Locked);}- assert!(remembered);- }-- /// A quick PTT tap that lands entirely inside the busy window must net to- /// no-op: the press is remembered, the release forgets it, nothing starts.- #[test]- fn ptt_tap_inside_busy_window_nets_noop() {- assert_eq!(classify_busy_input(true, true, false), BusyAction::Remember);- assert_eq!(classify_busy_input(false, true, true), BusyAction::Forget);+ assert!(remembered.is_some());}// ---------------------------------------------------------------------@@ -669,7 +893,8 @@ mod tests {binding_id: BINDING.to_string(),hotkey_string: BINDING.to_string(),is_pressed,- push_to_talk: true,+ mode: ShortcutActivation::PushToTalk,+ hold_threshold: Duration::ZERO,external: false,}}@@ -806,7 +1031,8 @@ mod tests {binding_id: BINDING.to_string(),hotkey_string: BINDING.to_string(),is_pressed: true,- push_to_talk: false,+ mode: ShortcutActivation::Toggle,+ hold_threshold: Duration::ZERO,external: true,},at,@@ -867,7 +1093,8 @@ mod tests {binding_id: binding_id.to_string(),hotkey_string: binding_id.to_string(),is_pressed: true,- push_to_talk: false,+ mode: ShortcutActivation::Toggle,+ hold_threshold: Duration::ZERO,external,}}@@ -977,4 +1204,414 @@ mod tests {state.on_start_result(BINDING, false);assert_eq!(state.stage, Stage::Idle);}++ // ---------------------------------------------------------------------+ // Hold-or-toggle (the combined mode from #147) and the two legacy modes,+ // driven through the real machine on a synthetic clock. Recording starts+ // on key-down in every mode; the tests pin how each mode ends it.+ // ---------------------------------------------------------------------++ const HOLD_THRESHOLD: Duration = Duration::from_millis(300);++ fn input(mode: ShortcutActivation, is_pressed: bool) -> InputEvent {+ InputEvent {+ binding_id: BINDING.to_string(),+ hotkey_string: BINDING.to_string(),+ is_pressed,+ mode,+ hold_threshold: HOLD_THRESHOLD,+ external: false,+ }+ }++ fn ms(n: u64) -> Duration {+ Duration::from_millis(n)+ }++ /// Hold-or-toggle: a key held past the threshold is push-to-talk — the+ /// (deferred) release stops recording.+ #[test]+ fn hold_or_toggle_long_hold_stops_on_release() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ assert!(matches!(+ state.on_input(input(mode, true), t0),+ Some(Effect::Start { .. })+ ));+ assert!(state.on_input(input(mode, false), t0 + ms(800)).is_none());+ assert!(+ matches!(state.on_grace_expired(), Some(Effect::Stop { .. })),+ "an 800ms hold must stop when its release grace elapses"+ );+ assert_eq!(state.stage, Stage::Processing);+ }++ /// Hold-or-toggle: a tap keeps recording (locked on); the next press stops.+ #[test]+ fn hold_or_toggle_tap_locks_recording_until_next_press() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ assert!(matches!(+ state.on_input(input(mode, true), t0),+ Some(Effect::Start { .. })+ ));+ assert!(state.on_input(input(mode, false), t0 + ms(120)).is_none());+ assert!(+ state.on_grace_expired().is_none(),+ "a 120ms tap must not stop recording"+ );+ assert_eq!(state.stage, Stage::Recording(BINDING.to_string()));+ assert!(state.is_locked());++ // Seconds later the user presses again to finish.+ assert!(matches!(+ state.on_input(input(mode, true), t0 + ms(5000)),+ Some(Effect::Stop { .. })+ ));+ assert_eq!(state.stage, Stage::Processing);+ // The release of that stopping press lands in the busy window and is+ // ignored, so nothing is remembered for the drain.+ assert!(state.on_input(input(mode, false), t0 + ms(5080)).is_none());+ assert!(state.on_processing_finished().is_none());+ assert_eq!(state.stage, Stage::Idle);+ }++ /// Hold-or-toggle: a locked session ignores stray releases — only a press+ /// ends it.+ #[test]+ fn hold_or_toggle_locked_session_ignores_release() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ state.on_input(input(mode, true), t0);+ state.on_input(input(mode, false), t0 + ms(100));+ assert!(state.on_grace_expired().is_none());+ assert!(state.is_locked());++ assert!(state.on_input(input(mode, false), t0 + ms(900)).is_none());+ assert!(+ state.grace_deadline().is_none(),+ "no release may be deferred once locked"+ );+ assert_eq!(state.stage, Stage::Recording(BINDING.to_string()));+ }++ /// Hold-or-toggle: while the key is genuinely held, extra presses do not+ /// stop the recording (that is the release's job).+ #[test]+ fn hold_or_toggle_press_while_held_is_ignored() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ state.on_input(input(mode, true), t0);+ assert!(state.on_input(input(mode, true), t0 + ms(400)).is_none());+ assert_eq!(state.stage, Stage::Recording(BINDING.to_string()));+ assert!(!state.is_locked());+ }++ /// Hold-or-toggle under X11 auto-repeat: the synthesized release/press+ /// pairs must not be misread as taps. The hold is measured from the+ /// original key-down to the genuine key-up.+ #[test]+ fn hold_or_toggle_autorepeat_burst_is_one_long_hold() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ let mut clock = t0;++ assert!(matches!(+ state.on_input(input(mode, true), clock),+ Some(Effect::Start { .. })+ ));+ // ~600ms of auto-repeat pairs a few ms apart.+ for _ in 0..60 {+ clock += ms(5);+ assert!(state.on_input(input(mode, false), clock).is_none());+ clock += ms(5);+ assert!(state.on_input(input(mode, true), clock).is_none());+ assert!(+ state.grace_deadline().is_none(),+ "auto-repeat press must cancel the deferred release"+ );+ }+ assert!(!state.is_locked(), "no tap may be classified mid-burst");++ clock += ms(5);+ assert!(state.on_input(input(mode, false), clock).is_none());+ assert!(+ matches!(state.on_grace_expired(), Some(Effect::Stop { .. })),+ "the genuine release after a ~600ms hold must stop recording"+ );+ }++ /// Hold-or-toggle: a press remembered during the busy window is measured+ /// from the real key-down, so a hold that straddles the drain still counts+ /// as a hold when it is released shortly after recording actually starts.+ #[test]+ fn hold_or_toggle_remembered_press_measures_hold_from_real_key_down() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ // Previous session: hold, release, stop → Processing.+ state.on_input(input(mode, true), t0);+ state.on_input(input(mode, false), t0 + ms(800));+ assert!(matches!(+ state.on_grace_expired(),+ Some(Effect::Stop { .. })+ ));++ // Pressed again while busy; still held when the pipeline drains 700ms later.+ assert!(state.on_input(input(mode, true), t0 + ms(1000)).is_none());+ assert!(matches!(+ state.on_processing_finished(),+ Some(Effect::Start { .. })+ ));+ // Released 100ms after recording began — but 800ms after key-down.+ assert!(state.on_input(input(mode, false), t0 + ms(1800)).is_none());+ assert!(+ matches!(state.on_grace_expired(), Some(Effect::Stop { .. })),+ "held 800ms overall: must stop, not lock"+ );+ }++ /// Toggle: releases never stop, the next press does. (Toggle is the+ /// combined machine with the session locked from the start.)+ #[test]+ fn toggle_mode_ignores_release_and_stops_on_next_press() {+ let mode = ShortcutActivation::Toggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ assert!(matches!(+ state.on_input(input(mode, true), t0),+ Some(Effect::Start { .. })+ ));+ assert!(state.is_locked());+ assert!(state.on_input(input(mode, false), t0 + ms(100)).is_none());+ assert!(+ state.grace_deadline().is_none(),+ "toggle never defers releases"+ );+ assert!(state.on_input(input(mode, false), t0 + ms(3000)).is_none());+ assert!(matches!(+ state.on_input(input(mode, true), t0 + ms(4000)),+ Some(Effect::Stop { .. })+ ));+ }++ /// Push-to-talk: even a very short press stops on release — there is no+ /// tap-to-lock in this mode (hold threshold of zero).+ #[test]+ fn push_to_talk_short_press_still_stops_on_release() {+ let mode = ShortcutActivation::PushToTalk;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ assert!(matches!(+ state.on_input(input(mode, true), t0),+ Some(Effect::Start { .. })+ ));+ assert!(state.on_input(input(mode, false), t0 + ms(40)).is_none());+ assert!(matches!(+ state.on_grace_expired(),+ Some(Effect::Stop { .. })+ ));+ }++ /// Cancel (Escape) during a locked hold-or-toggle session resets cleanly so+ /// the next press starts a fresh recording rather than stopping a dead one.+ #[test]+ fn hold_or_toggle_cancel_clears_locked_session() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ state.on_input(input(mode, true), t0);+ state.on_input(input(mode, false), t0 + ms(100));+ assert!(state.on_grace_expired().is_none());+ assert!(state.is_locked());++ state.on_cancel(true);+ assert_eq!(state.stage, Stage::Idle);+ assert!(!state.is_locked());+ assert!(matches!(+ state.on_input(input(mode, true), t0 + ms(2000)),+ Some(Effect::Start { .. })+ ));+ }++ /// Switching to toggle while an unlocked hold recording is running must not+ /// strand it: in toggle mode a press always stops.+ #[test]+ fn toggle_press_stops_recording_started_as_hold() {+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();++ state.on_input(input(ShortcutActivation::HoldOrToggle, true), t0);+ assert!(!state.is_locked());+ assert!(matches!(+ state.on_input(input(ShortcutActivation::Toggle, true), t0 + ms(2000)),+ Some(Effect::Stop { .. })+ ));+ }++ // Hold-vs-tap classification while the previous transcription is busy.+ fn hold_or_toggle_into_processing(state: &mut CoordinatorState, t0: Instant) {+ let mode = ShortcutActivation::HoldOrToggle;+ assert!(matches!(+ state.on_input(input(mode, true), t0),+ Some(Effect::Start { .. })+ ));+ assert!(state.on_input(input(mode, false), t0 + ms(800)).is_none());+ assert!(matches!(+ state.on_grace_expired(),+ Some(Effect::Stop { .. })+ ));+ assert_eq!(state.stage, Stage::Processing);+ }++ #[test]+ fn hold_or_toggle_tap_during_processing_queues_locked_start() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ assert!(state.on_input(input(mode, true), t0 + ms(1000)).is_none());+ assert!(state.on_input(input(mode, false), t0 + ms(1100)).is_none());+ assert!(state.on_grace_expired().is_none());+ assert!(state.is_locked(), "a busy tap should queue a locked start");+ assert!(matches!(+ state.on_processing_finished(),+ Some(Effect::Start { .. })+ ));+ assert!(state.is_locked());+ }++ #[test]+ fn hold_or_toggle_completed_hold_during_processing_nets_noop() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ assert!(state.on_input(input(mode, true), t0 + ms(1000)).is_none());+ assert!(state.on_input(input(mode, false), t0 + ms(1600)).is_none());+ assert!(state.on_grace_expired().is_none());+ assert!(!state.is_locked());++ assert!(+ state.on_processing_finished().is_none(),+ "a 600ms hold that ended before the drain has nothing left to start"+ );+ assert_eq!(state.stage, Stage::Idle);+ }++ #[test]+ fn hold_or_toggle_two_taps_during_processing_net_noop() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ assert!(state.on_input(input(mode, true), t0 + ms(1000)).is_none());+ assert!(state.on_input(input(mode, false), t0 + ms(1100)).is_none());+ assert!(state.on_grace_expired().is_none());+ assert!(state.is_locked());++ assert!(state.on_input(input(mode, true), t0 + ms(1500)).is_none());+ assert!(+ !state.is_locked(),+ "the second tap's press forgets the queued tap"+ );+ assert!(state.on_input(input(mode, false), t0 + ms(1600)).is_none());+ assert!(state.grace_deadline().is_none());++ assert!(state.on_processing_finished().is_none());+ assert_eq!(state.stage, Stage::Idle);+ }++ #[test]+ fn ptt_tap_inside_busy_window_nets_noop() {+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ assert!(state.on_input(ptt_input(true), t0 + ms(1000)).is_none());+ assert!(state.on_input(ptt_input(false), t0 + ms(1040)).is_none());+ assert!(state.on_grace_expired().is_none());+ assert!(state.on_processing_finished().is_none());+ }++ /// The pipeline drains inside the 50ms grace of a busy tap: recording+ /// starts first (unlocked, from the real key-down), and the grace then+ /// resolves against the live recording, locking it as the tap it was.+ #[test]+ fn hold_or_toggle_drain_inside_busy_release_grace_still_classifies_tap() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ assert!(state.on_input(input(mode, true), t0 + ms(1000)).is_none());+ assert!(state.on_input(input(mode, false), t0 + ms(1100)).is_none());+ assert!(matches!(+ state.on_processing_finished(),+ Some(Effect::Start { .. })+ ));+ assert!(!state.is_locked());++ assert!(state.on_grace_expired().is_none());+ assert!(state.is_locked(), "the deferred 100ms release is a tap");+ }++ /// X11 auto-repeat while busy, key still held at the drain: recording+ /// starts measured from the first press, not from the last synthesized+ /// press before the drain. Released 400ms after the real key-down but+ /// only ~100ms after the drain — a hold, so it must stop rather than lock.+ #[test]+ fn hold_or_toggle_autorepeat_burst_straddling_drain_measures_from_first_press() {+ let mode = ShortcutActivation::HoldOrToggle;+ let mut state = CoordinatorState::new();+ let t0 = Instant::now();+ hold_or_toggle_into_processing(&mut state, t0);++ let mut clock = t0 + ms(1000);+ assert!(state.on_input(input(mode, true), clock).is_none());+ for _ in 0..30 {+ clock += ms(5);+ assert!(state.on_input(input(mode, false), clock).is_none());+ clock += ms(5);+ assert!(state.on_input(input(mode, true), clock).is_none());+ assert!(state.grace_deadline().is_none());+ }++ // Drain at ~t0 + 1300ms with the key still down.+ assert!(matches!(+ state.on_processing_finished(),+ Some(Effect::Start { .. })+ ));+ assert!(!state.is_locked());++ for _ in 0..10 {+ clock += ms(5);+ assert!(state.on_input(input(mode, false), clock).is_none());+ clock += ms(5);+ assert!(state.on_input(input(mode, true), clock).is_none());+ }+ assert_eq!(clock, t0 + ms(1400));+ assert!(state.on_input(input(mode, false), clock).is_none());+ assert!(+ matches!(state.on_grace_expired(), Some(Effect::Stop { .. })),+ "held 400ms since the real key-down: must stop, not lock"+ );+ assert_eq!(state.stage, Stage::Processing);+ }}diff --git a/src/bindings.ts b/src/bindings.tsindex 8570ea68..c6d39535 100644--- a/src/bindings.ts+++ b/src/bindings.ts@@ -21,9 +21,17 @@ async resetBinding(id: string) : Promise<Result<BindingResponse, string>> {else return { status: "error", error: e as any };}},-async changePttSetting(enabled: boolean) : Promise<Result<null, string>> {+async changeShortcutActivationSetting(activation: ShortcutActivation) : Promise<Result<null, string>> {try {- return { status: "ok", data: await TAURI_INVOKE("change_ptt_setting", { enabled }) };+ return { status: "ok", data: await TAURI_INVOKE("change_shortcut_activation_setting", { activation }) };+} catch (e) {+ if(e instanceof Error) throw e;+ else return { status: "error", error: e as any };+}+},+async changeHoldThresholdMsSetting(ms: number) : Promise<Result<null, string>> {+ try {+ return { status: "ok", data: await TAURI_INVOKE("change_hold_threshold_ms_setting", { ms }) };} catch (e) {if(e instanceof Error) throw e;else return { status: "error", error: e as any };@@ -952,7 +960,17 @@ settings_schema_version?: number;* Defaults to empty on partial stores; the load path merges in the* default bindings for any missing keys before the settings are used.*/-bindings?: Partial<{ [key in string]: ShortcutBinding }>; push_to_talk?: boolean; audio_feedback?: boolean; audio_feedback_volume?: number; sound_theme?: SoundTheme; start_hidden?: boolean; autostart_enabled?: boolean; update_checks_enabled?: boolean; show_whats_new_on_update?: boolean;+bindings?: Partial<{ [key in string]: ShortcutBinding }>;+/**+ * Replaces the pre-0.10 `push_to_talk` bool; stores missing this key are+ * migrated from it in `apply_settings_migrations`.+ */+shortcut_activation?: ShortcutActivation;+/**+ * Hold-or-toggle only: a press held at least this long is push-to-talk,+ * anything shorter is a tap that locks recording on.+ */+hold_threshold_ms?: number; audio_feedback?: boolean; audio_feedback_volume?: number; sound_theme?: SoundTheme; start_hidden?: boolean; autostart_enabled?: boolean; update_checks_enabled?: boolean; show_whats_new_on_update?: boolean;/*** The app version whose What's New the user has already seen. Fresh installs* default to the current version (nothing is "new" to them). Existing users@@ -1093,6 +1111,24 @@ uncovered_bindings: string[];* warning banner appears and explains why recording refused.*/recorder_blocked: boolean }+/**+ * How the transcribe shortcut's key events drive a recording.+ */+export type ShortcutActivation =+/**+ * Press to start, press again to stop.+ */+"toggle" |+/**+ * Hold to record, release to stop.+ */+"push_to_talk" |+/**+ * Hold to record and release to stop, or tap to keep recording until the+ * next press. Which one it was is decided by how long the key was held+ * (`hold_threshold_ms`).+ */+"hold_or_toggle"export type ShortcutBinding = { id: string; name: string; description: string; default_binding: string; current_binding: string }export type SoundTheme = "marimba" | "pop" | "custom"/**diff --git a/src/components/settings/PushToTalk.tsx b/src/components/settings/PushToTalk.tsxdeleted file mode 100644index 333d26d2..00000000--- a/src/components/settings/PushToTalk.tsx+++ /dev/null@@ -1,30 +0,0 @@-import React from "react";-import { useTranslation } from "react-i18next";-import { ToggleSwitch } from "../ui/ToggleSwitch";-import { useSettings } from "../../hooks/useSettings";--interface PushToTalkProps {- descriptionMode?: "inline" | "tooltip";- grouped?: boolean;-}--export const PushToTalk: React.FC<PushToTalkProps> = React.memo(- ({ descriptionMode = "tooltip", grouped = false }) => {- const { t } = useTranslation();- const { getSetting, updateSetting, isUpdating } = useSettings();-- const pttEnabled = getSetting("push_to_talk") || false;-- return (- <ToggleSwitch- checked={pttEnabled}- onChange={(enabled) => updateSetting("push_to_talk", enabled)}- isUpdating={isUpdating("push_to_talk")}- label={t("settings.general.pushToTalk.label")}- description={t("settings.general.pushToTalk.description")}- descriptionMode={descriptionMode}- grouped={grouped}- />- );- },-);diff --git a/src/components/settings/ShortcutActivation.tsx b/src/components/settings/ShortcutActivation.tsxnew file mode 100644index 00000000..0d26c57c--- /dev/null+++ b/src/components/settings/ShortcutActivation.tsx@@ -0,0 +1,63 @@+import React from "react";+import { useTranslation } from "react-i18next";+import { Dropdown } from "../ui/Dropdown";+import { SettingContainer } from "../ui/SettingContainer";+import { useSettings } from "../../hooks/useSettings";+import type { ShortcutActivation } from "@/bindings";++interface ShortcutActivationProps {+ descriptionMode?: "inline" | "tooltip";+ grouped?: boolean;+}++export const ShortcutActivationSetting: React.FC<ShortcutActivationProps> =+ React.memo(({ descriptionMode = "tooltip", grouped = false }) => {+ const { t } = useTranslation();+ const { getSetting, updateSetting, isUpdating } = useSettings();++ const options = [+ {+ value: "hold_or_toggle",+ label: t("settings.general.shortcutActivation.options.holdOrToggle"),+ description: t(+ "settings.general.shortcutActivation.descriptions.hold_or_toggle",+ ),+ },+ {+ value: "push_to_talk",+ label: t("settings.general.shortcutActivation.options.pushToTalk"),+ description: t(+ "settings.general.shortcutActivation.descriptions.push_to_talk",+ ),+ },+ {+ value: "toggle",+ label: t("settings.general.shortcutActivation.options.toggle"),+ description: t(+ "settings.general.shortcutActivation.descriptions.toggle",+ ),+ },+ ];++ const selected = (getSetting("shortcut_activation") ||+ "hold_or_toggle") as ShortcutActivation;++ return (+ <SettingContainer+ title={t("settings.general.shortcutActivation.title")}+ description={t("settings.general.shortcutActivation.description")}+ descriptionMode={descriptionMode}+ grouped={grouped}+ >+ <Dropdown+ options={options}+ menuClassName="right-0 w-80 max-w-[calc(100vw-2rem)]"+ selectedValue={selected}+ onSelect={(value) =>+ updateSetting("shortcut_activation", value as ShortcutActivation)+ }+ disabled={isUpdating("shortcut_activation")}+ />+ </SettingContainer>+ );+ });diff --git a/src/components/settings/debug/DebugSettings.tsx b/src/components/settings/debug/DebugSettings.tsxindex dd65ae57..e9d9ccff 100644--- a/src/components/settings/debug/DebugSettings.tsx+++ b/src/components/settings/debug/DebugSettings.tsx@@ -4,6 +4,7 @@ import { WordCorrectionThreshold } from "./WordCorrectionThreshold";import { LogLevelSelector } from "./LogLevelSelector";import { LiveLogViewer } from "./LiveLogViewer";import { PasteDelay } from "./PasteDelay";+import { HoldThreshold } from "./HoldThreshold";import { ReliablePasteToggle } from "./ReliablePaste";import { RecordingBuffer } from "./RecordingBuffer";import { SettingsGroup } from "../../ui/SettingsGroup";@@ -37,6 +38,7 @@ export const DebugSettings: React.FC = () => {descriptionKey="settings.debug.pasteDelayAfter.description"/><ReliablePasteToggle descriptionMode="tooltip" grouped={true} />+ <HoldThreshold descriptionMode="tooltip" grouped={true} /><RecordingBuffer descriptionMode="tooltip" grouped={true} /><AlwaysOnMicrophone descriptionMode="tooltip" grouped={true} /><ClamshellMicrophoneSelector descriptionMode="tooltip" grouped={true} />diff --git a/src/components/settings/debug/HoldThreshold.tsx b/src/components/settings/debug/HoldThreshold.tsxnew file mode 100644index 00000000..ae308abc--- /dev/null+++ b/src/components/settings/debug/HoldThreshold.tsx@@ -0,0 +1,38 @@+import React from "react";+import { useTranslation } from "react-i18next";+import { Slider } from "../../ui/Slider";+import { useSettings } from "../../../hooks/useSettings";++interface HoldThresholdProps {+ descriptionMode?: "tooltip" | "inline";+ grouped?: boolean;+}++/**+ * Hold-or-toggle only: how long the transcribe key must be held before the+ * press counts as push-to-talk instead of a tap.+ */+export const HoldThreshold: React.FC<HoldThresholdProps> = ({+ descriptionMode = "tooltip",+ grouped = false,+}) => {+ const { t } = useTranslation();+ const { settings, updateSetting, resetSetting, isUpdating } = useSettings();++ return (+ <Slider+ value={settings?.hold_threshold_ms ?? 300}+ onChange={(value) => updateSetting("hold_threshold_ms", value)}+ onReset={() => resetSetting("hold_threshold_ms")}+ isResetting={isUpdating("hold_threshold_ms")}+ min={100}+ max={1000}+ step={50}+ label={t("settings.debug.holdThreshold.title")}+ description={t("settings.debug.holdThreshold.description")}+ descriptionMode={descriptionMode}+ grouped={grouped}+ formatValue={(v) => `${v}ms`}+ />+ );+};diff --git a/src/components/settings/general/GeneralSettings.tsx b/src/components/settings/general/GeneralSettings.tsxindex 314c00fa..7318236f 100644--- a/src/components/settings/general/GeneralSettings.tsx+++ b/src/components/settings/general/GeneralSettings.tsx@@ -6,7 +6,7 @@ import { ChannelSelector } from "../ChannelSelector";import { ShortcutInput } from "../ShortcutInput";import { SettingsGroup } from "../../ui/SettingsGroup";import { OutputDeviceSelector } from "../OutputDeviceSelector";-import { PushToTalk } from "../PushToTalk";+import { ShortcutActivationSetting } from "../ShortcutActivation";import { AudioFeedback } from "../AudioFeedback";import { useSettings } from "../../../hooks/useSettings";import { VolumeSlider } from "../VolumeSlider";@@ -15,18 +15,15 @@ import { ModelSettingsCard } from "./ModelSettingsCard";export const GeneralSettings: React.FC = () => {const { t } = useTranslation();- const { audioFeedbackEnabled, getSetting } = useSettings();- const pushToTalk = getSetting("push_to_talk");+ const { audioFeedbackEnabled } = useSettings();const isLinux = type() === "linux";return (<div className="max-w-3xl w-full mx-auto space-y-6"><SettingsGroup title={t("settings.general.title")}><ShortcutInput shortcutId="transcribe" grouped={true} />- <PushToTalk descriptionMode="tooltip" grouped={true} />- {/* Cancel shortcut is hidden with push-to-talk (release key cancels) and on Linux (dynamic shortcut instability) */}- {!isLinux && !pushToTalk && (- <ShortcutInput shortcutId="cancel" grouped={true} />- )}+ <ShortcutActivationSetting descriptionMode="tooltip" grouped={true} />+ {/* Cancel shortcut remains hidden on Linux because of dynamic shortcut instability. */}+ {!isLinux && <ShortcutInput shortcutId="cancel" grouped={true} />}</SettingsGroup><ModelSettingsCard /><SettingsGroup title={t("settings.sound.title")}>diff --git a/src/components/settings/index.ts b/src/components/settings/index.tsindex a10240af..115c209b 100644--- a/src/components/settings/index.ts+++ b/src/components/settings/index.ts@@ -13,7 +13,7 @@ export { ChannelSelector } from "./ChannelSelector";export { ClamshellMicrophoneSelector } from "./ClamshellMicrophoneSelector";export { OutputDeviceSelector } from "./OutputDeviceSelector";export { AlwaysOnMicrophone } from "./AlwaysOnMicrophone";-export { PushToTalk } from "./PushToTalk";+export { ShortcutActivationSetting } from "./ShortcutActivation";export { AudioFeedback } from "./AudioFeedback";export { ShowOverlay } from "./ShowOverlay";export { GlobalShortcutInput } from "./GlobalShortcutInput";diff --git a/src/components/ui/Dropdown.tsx b/src/components/ui/Dropdown.tsxindex 0276621b..4143415f 100644--- a/src/components/ui/Dropdown.tsx+++ b/src/components/ui/Dropdown.tsx@@ -4,12 +4,14 @@ import { useTranslation } from "react-i18next";export interface DropdownOption {value: string;label: string;+ description?: string;disabled?: boolean;}interface DropdownProps {options: DropdownOption[];className?: string;+ menuClassName?: string;selectedValue: string | null;onSelect: (value: string) => void;placeholder?: string;@@ -22,6 +24,7 @@ export const Dropdown: React.FC<DropdownProps> = ({selectedValue,onSelect,className = "",+ menuClassName,placeholder = "Select an option...",disabled = false,onRefresh,@@ -86,7 +89,11 @@ export const Dropdown: React.FC<DropdownProps> = ({</svg></button>{isOpen && !disabled && (- <div className="absolute top-full left-0 right-0 mt-1 bg-background border border-mid-gray/80 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto">+ <div+ className={`absolute top-full mt-1 bg-background border border-mid-gray/80 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto ${+ menuClassName ?? "left-0 right-0"+ }`}+ >{options.length === 0 ? (<div className="px-2 py-1 text-sm text-mid-gray">{t("common.noOptionsFound")}@@ -96,17 +103,28 @@ export const Dropdown: React.FC<DropdownProps> = ({<buttonkey={option.value}type="button"- className={`w-full px-2 py-1 text-sm text-start hover:bg-logo-primary/10 transition-colors duration-150 ${- selectedValue === option.value- ? "bg-logo-primary/20 font-semibold"- : ""+ className={`w-full text-sm text-start hover:bg-logo-primary/10 transition-colors duration-150 ${+ option.description ? "px-3 py-2" : "px-2 py-1"+ } ${+ selectedValue === option.value ? "bg-logo-primary/20" : ""} ${option.disabled ? "opacity-50 cursor-not-allowed" : ""}`}onClick={() => handleSelect(option.value)}disabled={option.disabled}>- <span className="whitespace-normal break-words">+ <span+ className={`block whitespace-normal break-words ${+ option.description || selectedValue === option.value+ ? "font-semibold"+ : ""+ }`}+ >{option.label}</span>+ {option.description && (+ <span className="mt-0.5 block whitespace-normal text-xs font-normal leading-snug text-mid-gray">+ {option.description}+ </span>+ )}</button>)))}diff --git a/src/content/release-notes/0.9.7.md b/src/content/release-notes/0.9.7.mdnew file mode 100644index 00000000..029ee545--- /dev/null+++ b/src/content/release-notes/0.9.7.md@@ -0,0 +1,11 @@+## New Shortcut Behavior++Handy now has an **Auto** shortcut mode, so the same shortcut can work as both push-to-talk and a toggle. It is the default for new installs.++- **Auto** — Hold to record and release to stop, or tap once to start and tap again to stop.+- **Hold** — Records only while you hold the shortcut. This is the old push-to-talk behavior.+- **Toggle** — Tap once to start recording and tap again to stop.++Existing users will keep their current shortcut behavior after updating. To try Auto, go to **General → Shortcut Behavior**.++diff --git a/src/i18n/locales/ar/translation.json b/src/i18n/locales/ar/translation.jsonindex 64d94c56..67608192 100644--- a/src/i18n/locales/ar/translation.json+++ b/src/i18n/locales/ar/translation.json@@ -191,9 +191,19 @@"noResults": "لم يتم العثور على لغات","auto": "تلقائي"},- "pushToTalk": {- "label": "اضغط للتحدث",- "description": "استمر في الضغط للتسجيل، واترك للتوقف"+ "shortcutActivation": {+ "title": "سلوك الاختصار",+ "description": "اختر كيفية بدء التسجيل وإيقافه باستخدام اختصار التفريغ الصوتي.",+ "options": {+ "holdOrToggle": "تلقائي",+ "pushToTalk": "ضغط مطوّل",+ "toggle": "تبديل"+ },+ "descriptions": {+ "hold_or_toggle": "اضغط مطوّلًا للتسجيل أو انقر للتبديل",+ "push_to_talk": "يسجّل أثناء الضغط على الاختصار",+ "toggle": "انقر على الاختصار لبدء التسجيل، وانقر مرة أخرى للإيقاف"+ }}},"sound": {@@ -523,6 +533,10 @@"title": "تأخير اللصق (بعد)","description": "التأخير (بالمللي ثانية) بعد ضغطة مفتاح اللصق وقبل استعادة محتوى الحافظة السابق. قم بزيادته إذا تم لصق محتوى الحافظة القديم بدلاً من النص المُفرَّغ."},+ "holdThreshold": {+ "title": "حد الضغط المطوّل",+ "description": "في الوضع التلقائي فقط: المدة (بالمللي ثانية) التي يجب الاستمرار في الضغط على الاختصار خلالها ليُعدّ ضغطًا مطوّلًا بدلًا من نقرة. قلّلها إذا ظلّ التسجيل مستمرًا بعد ضغطات مطوّلة قصيرة؛ وزدها إذا عُوملت النقرات المقصودة على أنها ضغط مطوّل."+ },"reliablePaste": {"title": "لصق موثوق (Beta)","description": "استعادة الحافظة فقط بعد أن يقرأ التطبيق المستهدف النص المُفرَّغ فعلياً، بدلاً من الاعتماد على تأخير ثابت. يهدف إلى إصلاح لصق محتوى الحافظة القديم عند وجود حمل على النظام. يتطلب طريقة لصق تعتمد على الحافظة؛ على macOS وWindows فقط."diff --git a/src/i18n/locales/bg/translation.json b/src/i18n/locales/bg/translation.jsonindex 5f363f90..cd81ae28 100644--- a/src/i18n/locales/bg/translation.json+++ b/src/i18n/locales/bg/translation.json@@ -194,9 +194,19 @@"noResults": "Няма намерени езици","auto": "Автоматично"},- "pushToTalk": {- "label": "Натискане за говорене",- "description": "Задръжте за запис, пуснете за спиране"+ "shortcutActivation": {+ "title": "Поведение на клавишната комбинация",+ "description": "Изберете как бързият клавиш за транскрипция стартира и спира записа.",+ "options": {+ "holdOrToggle": "Автоматично",+ "pushToTalk": "Задържане",+ "toggle": "Превключване"+ },+ "descriptions": {+ "hold_or_toggle": "Задръжте за запис или натиснете кратко за превключване",+ "push_to_talk": "Записва, докато държите комбинацията натисната",+ "toggle": "Натиснете кратко комбинацията, за да започне записът, и отново, за да спре"+ }}},"models": {@@ -546,6 +556,10 @@"title": "Забавяне при поставяне (след)","description": "Забавяне (в милисекунди) след клавиша за поставяне, преди възстановяване на предишния клипборд. Увеличете, ако вместо транскрипцията се поставя старото съдържание на клипборда."},+ "holdThreshold": {+ "title": "Праг на задържане",+ "description": "Само в автоматичен режим: колко дълго (в милисекунди) трябва да се задържи комбинацията, за да се брои за задържане вместо за кратко натискане. Намалете, ако след кратки задържания записът продължава; увеличете, ако умишлените кратки натискания се приемат за задържане."+ },"reliablePaste": {"title": "Надеждно поставяне (Beta)","description": "Възстановява клипборда само след като целевото приложение действително прочете транскрипцията, вместо след фиксирано забавяне. Предназначено да отстрани поставянето на старото съдържание на клипборда при натоварване на системата. Изисква начин на поставяне през клипборда; само за macOS и Windows."diff --git a/src/i18n/locales/cs/translation.json b/src/i18n/locales/cs/translation.jsonindex 929fa61c..ee67e00f 100644--- a/src/i18n/locales/cs/translation.json+++ b/src/i18n/locales/cs/translation.json@@ -214,9 +214,19 @@"noResults": "Žádné jazyky nenalezeny","auto": "Automaticky"},- "pushToTalk": {- "label": "Stisk a mluv",- "description": "Podržte pro nahrávání, uvolněte pro zastavení"+ "shortcutActivation": {+ "title": "Chování zkratky",+ "description": "Zvolte, jak má zkratka přepisu spouštět a zastavovat nahrávání.",+ "options": {+ "holdOrToggle": "Automaticky",+ "pushToTalk": "Podržet",+ "toggle": "Přepínat"+ },+ "descriptions": {+ "hold_or_toggle": "Podržte pro nahrávání nebo klepněte pro přepnutí",+ "push_to_talk": "Nahrává, dokud držíte zkratku",+ "toggle": "Klepněte na zkratku pro zahájení nahrávání, klepněte znovu pro zastavení"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Zpoždění vložení (po)","description": "Zpoždění (v milisekundách) po klávese pro vložení, před obnovením předchozí schránky. Zvyšte, pokud se místo přepisu vkládá starý obsah schránky."},+ "holdThreshold": {+ "title": "Práh podržení",+ "description": "Pouze v automatickém režimu: jak dlouho (v milisekundách) musí být zkratka držena, aby se počítala jako podržení místo klepnutí. Snižte, pokud po krátkém podržení nahrávání zůstává zapnuté; zvyšte, pokud jsou záměrná klepnutí vyhodnocena jako podržení."+ },"reliablePaste": {"title": "Spolehlivé vložení (Beta)","description": "Obnoví schránku teprve poté, co cílová aplikace skutečně přečte přepis, místo po pevně daném zpoždění. Má odstranit vkládání starého obsahu schránky při zatížení systému. Vyžaduje způsob vložení přes schránku; pouze macOS a Windows."diff --git a/src/i18n/locales/da/translation.json b/src/i18n/locales/da/translation.jsonindex efbe92b3..a5d4c7a0 100644--- a/src/i18n/locales/da/translation.json+++ b/src/i18n/locales/da/translation.json@@ -194,9 +194,19 @@"noResults": "Ingen sprog fundet","auto": "Automatisk"},- "pushToTalk": {- "label": "Tryk-for-at-tale",- "description": "Hold nede for at optage, slip for at stoppe"+ "shortcutActivation": {+ "title": "Genvejens adfærd",+ "description": "Vælg, hvordan transskriptionsgenvejen starter og stopper optagelsen.",+ "options": {+ "holdOrToggle": "Automatisk",+ "pushToTalk": "Hold",+ "toggle": "Skift"+ },+ "descriptions": {+ "hold_or_toggle": "Hold nede for at optage, eller tryk kort for at slå til/fra",+ "push_to_talk": "Optager, mens du holder genvejen nede",+ "toggle": "Tryk på genvejen for at starte optagelsen, tryk igen for at stoppe"+ }}},"models": {@@ -553,6 +563,10 @@"title": "Forsinkelse af indsættelse (efter)","description": "Forsinkelse (i millisekunder) efter tastetrykket for indsætning, før din tidligere udklipsholder gendannes. Øg, hvis dit gamle udklipsholderindhold bliver indsat i stedet for transskriptionen."},+ "holdThreshold": {+ "title": "Holdetærskel",+ "description": "Kun i automatisk tilstand: hvor længe (i millisekunder) genvejen skal holdes nede, før det tæller som et hold i stedet for et tryk. Sænk værdien, hvis korte hold lader optagelsen køre videre; hæv den, hvis bevidste tryk behandles som hold."+ },"reliablePaste": {"title": "Pålidelig indsættelse (Beta)","description": "Gendan først din udklipsholder, når målappen faktisk har læst transskriptionen, i stedet for efter en fast forsinkelse. Skal afhjælpe, at gammelt udklipsholderindhold indsættes, når systemet er belastet. Kræver en indsætningsmetode via udklipsholderen; kun macOS og Windows."diff --git a/src/i18n/locales/de/translation.json b/src/i18n/locales/de/translation.jsonindex 241266d1..a5ea8632 100644--- a/src/i18n/locales/de/translation.json+++ b/src/i18n/locales/de/translation.json@@ -214,9 +214,19 @@"noResults": "Keine Sprachen gefunden","auto": "Automatisch"},- "pushToTalk": {- "label": "Push-to-Talk",- "description": "Gedrückt halten zum Aufnehmen, loslassen zum Stoppen"+ "shortcutActivation": {+ "title": "Verhalten der Tastenkombination",+ "description": "Wähle aus, wie das Transkriptions-Tastenkürzel die Aufnahme startet und beendet.",+ "options": {+ "holdOrToggle": "Automatisch",+ "pushToTalk": "Halten",+ "toggle": "Umschalten"+ },+ "descriptions": {+ "hold_or_toggle": "Gedrückt halten zum Aufnehmen oder antippen zum Umschalten",+ "push_to_talk": "Nimmt auf, solange die Tastenkombination gedrückt bleibt",+ "toggle": "Tastenkombination antippen, um die Aufnahme zu starten, erneut antippen zum Stoppen"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Einfügeverzögerung (nachher)","description": "Verzögerung (in Millisekunden) nach dem Einfüge-Tastendruck, bevor deine vorherige Zwischenablage wiederhergestellt wird. Erhöhe den Wert, wenn der alte Inhalt der Zwischenablage statt der Transkription eingefügt wird."},+ "holdThreshold": {+ "title": "Halte-Schwellenwert",+ "description": "Nur im Modus „Automatisch“: wie lange (in Millisekunden) die Tastenkombination gedrückt bleiben muss, damit sie als Halten statt als Tippen zählt. Verringern, wenn die Aufnahme nach kurzem Halten weiterläuft; erhöhen, wenn bewusstes Tippen als Halten gewertet wird."+ },"reliablePaste": {"title": "Zuverlässiges Einfügen (Beta)","description": "Die Zwischenablage erst wiederherstellen, wenn die Ziel-App die Transkription tatsächlich gelesen hat, statt nach einer festen Verzögerung. Soll verhindern, dass bei Systemlast der alte Inhalt der Zwischenablage eingefügt wird. Erfordert eine Einfügemethode über die Zwischenablage; nur macOS und Windows."diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.jsonindex e9e1eb17..9baa17b6 100644--- a/src/i18n/locales/en/translation.json+++ b/src/i18n/locales/en/translation.json@@ -194,9 +194,19 @@"noResults": "No languages found","auto": "Auto"},- "pushToTalk": {- "label": "Push To Talk",- "description": "Hold to record, release to stop"+ "shortcutActivation": {+ "title": "Shortcut Behavior",+ "description": "Choose how the transcribe shortcut starts and stops recording.",+ "options": {+ "holdOrToggle": "Auto",+ "pushToTalk": "Hold",+ "toggle": "Toggle"+ },+ "descriptions": {+ "hold_or_toggle": "Hold to record or tap to toggle",+ "push_to_talk": "Records while you hold the shortcut",+ "toggle": "Tap the shortcut to start recording, tap again to stop"+ }}},"models": {@@ -553,6 +563,10 @@"title": "Paste Delay (After)","description": "Delay (in milliseconds) after the paste keystroke, before restoring your previous clipboard. Increase if your old clipboard content is being pasted instead of the transcription."},+ "holdThreshold": {+ "title": "Hold Threshold",+ "description": "Auto mode only: how long (in milliseconds) the shortcut must be held before it counts as a hold instead of a tap. Lower if short holds keep leaving recording on; raise if deliberate taps get treated as holds."+ },"reliablePaste": {"title": "Reliable Paste (Beta)","description": "Restore the clipboard only after the target app actually reads the transcription, instead of after a fixed delay. Intended to fix old clipboard content being pasted under system load. Requires a clipboard paste method; macOS and Windows only."diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.jsonindex fc79123e..e8482eb2 100644--- a/src/i18n/locales/es/translation.json+++ b/src/i18n/locales/es/translation.json@@ -214,9 +214,19 @@"noResults": "No se encontraron idiomas","auto": "Automático"},- "pushToTalk": {- "label": "Presionar para hablar",- "description": "Mantén presionado para grabar, suelta para detener"+ "shortcutActivation": {+ "title": "Comportamiento del atajo",+ "description": "Elige cómo inicia y detiene la grabación el atajo de transcripción.",+ "options": {+ "holdOrToggle": "Automático",+ "pushToTalk": "Mantener",+ "toggle": "Alternar"+ },+ "descriptions": {+ "hold_or_toggle": "Mantén pulsado para grabar o toca para alternar",+ "push_to_talk": "Graba mientras mantienes pulsado el atajo",+ "toggle": "Toca el atajo para empezar a grabar, tócalo de nuevo para detener"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Retraso de pegado (después)","description": "Retraso (en milisegundos) después de la pulsación de tecla de pegar, antes de restaurar el portapapeles anterior. Auméntelo si se pega el contenido antiguo del portapapeles en lugar de la transcripción."},+ "holdThreshold": {+ "title": "Umbral de pulsación",+ "description": "Solo en el modo Automático: cuánto tiempo (en milisegundos) debe mantenerse pulsado el atajo para contar como mantener en lugar de un toque. Redúcelo si la grabación sigue activa tras pulsaciones cortas; auméntalo si los toques deliberados se interpretan como mantener."+ },"reliablePaste": {"title": "Pegado fiable (Beta)","description": "Restaura el portapapeles solo después de que la aplicación de destino lea realmente la transcripción, en lugar de tras un retraso fijo. Pensado para corregir que se pegue el contenido antiguo del portapapeles cuando el sistema está cargado. Requiere un método de pegado por portapapeles; solo macOS y Windows."diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.jsonindex 349ebb22..5db00197 100644--- a/src/i18n/locales/fr/translation.json+++ b/src/i18n/locales/fr/translation.json@@ -214,9 +214,19 @@"noResults": "Aucune langue trouvée","auto": "Automatique"},- "pushToTalk": {- "label": "Appuyer pour parler",- "description": "Maintenez pour enregistrer, relâchez pour arrêter"+ "shortcutActivation": {+ "title": "Comportement du raccourci",+ "description": "Choisissez comment le raccourci de transcription démarre et arrête l’enregistrement.",+ "options": {+ "holdOrToggle": "Auto",+ "pushToTalk": "Maintenir",+ "toggle": "Basculer"+ },+ "descriptions": {+ "hold_or_toggle": "Maintenez pour enregistrer ou appuyez brièvement pour basculer",+ "push_to_talk": "Enregistre tant que le raccourci est maintenu",+ "toggle": "Appuyez sur le raccourci pour démarrer l'enregistrement, appuyez à nouveau pour arrêter"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Délai de collage (après)","description": "Délai (en millisecondes) après la touche de collage, avant la restauration de votre presse-papiers précédent. Augmentez si l'ancien contenu du presse-papiers est collé à la place de la transcription."},+ "holdThreshold": {+ "title": "Seuil de maintien",+ "description": "Mode Auto uniquement : durée (en millisecondes) pendant laquelle le raccourci doit rester enfoncé pour compter comme un maintien plutôt qu'une pression brève. Diminuez si l'enregistrement reste actif après un maintien court ; augmentez si des pressions brèves volontaires sont traitées comme un maintien."+ },"reliablePaste": {"title": "Collage fiable (Beta)","description": "Restaure le presse-papiers uniquement après que l'application cible a réellement lu la transcription, au lieu d'attendre un délai fixe. Vise à corriger le collage de l'ancien contenu du presse-papiers lorsque le système est chargé. Nécessite une méthode de collage par presse-papiers ; macOS et Windows uniquement."diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.jsonindex bee57cd0..3c4e0b79 100644--- a/src/i18n/locales/he/translation.json+++ b/src/i18n/locales/he/translation.json@@ -194,9 +194,19 @@"noResults": "לא נמצאו שפות","auto": "אוטומטי"},- "pushToTalk": {- "label": "לחץ כדי לדבר",- "description": "החזק כדי להקליט, שחרר כדי לעצור"+ "shortcutActivation": {+ "title": "התנהגות קיצור הדרך",+ "description": "בחר כיצד קיצור התמלול מתחיל ומפסיק את ההקלטה.",+ "options": {+ "holdOrToggle": "אוטומטי",+ "pushToTalk": "לחיצה ארוכה",+ "toggle": "החלפת מצב"+ },+ "descriptions": {+ "hold_or_toggle": "לחצו לחיצה ארוכה כדי להקליט או הקישו כדי להחליף מצב",+ "push_to_talk": "מקליט כל עוד קיצור הדרך לחוץ",+ "toggle": "הקישו על קיצור הדרך כדי להתחיל להקליט, והקישו שוב כדי לעצור"+ }}},"models": {@@ -546,6 +556,10 @@"title": "השהיית הדבקה (אחרי)","description": "השהיה (במילישניות) לאחר צירוף ההדבקה, לפני שחזור הלוח הקודם. הגדל אם התוכן הישן של הלוח מודבק במקום התמלול."},+ "holdThreshold": {+ "title": "סף לחיצה ארוכה",+ "description": "במצב אוטומטי בלבד: כמה זמן (במילישניות) יש להחזיק את קיצור הדרך כדי שייחשב ללחיצה ארוכה במקום להקשה. הנמיכו אם ההקלטה ממשיכה לרוץ אחרי לחיצות ארוכות קצרות; הגביהו אם הקשות מכוונות מתפרשות כלחיצה ארוכה."+ },"reliablePaste": {"title": "הדבקה אמינה (Beta)","description": "שחזור הלוח רק אחרי שאפליקציית היעד קוראת בפועל את התמלול, במקום אחרי השהיה קבועה. נועד לתקן הדבקה של תוכן לוח ישן כשהמערכת עמוסה. דורש שיטת הדבקה דרך הלוח; ב-macOS וב-Windows בלבד."diff --git a/src/i18n/locales/hi/translation.json b/src/i18n/locales/hi/translation.jsonindex 059d5b7f..4d09e1ca 100644--- a/src/i18n/locales/hi/translation.json+++ b/src/i18n/locales/hi/translation.json@@ -194,9 +194,19 @@"noResults": "कोई भाषा नहीं मिली","auto": "ऑटो"},- "pushToTalk": {- "label": "पुश टू टॉक",- "description": "रिकॉर्ड करने के लिए दबाकर रखें, रोकने के लिए छोड़ दें"+ "shortcutActivation": {+ "title": "शॉर्टकट का व्यवहार",+ "description": "चुनें कि ट्रांसक्राइब शॉर्टकट रिकॉर्डिंग को कैसे शुरू और बंद करे।",+ "options": {+ "holdOrToggle": "स्वचालित",+ "pushToTalk": "दबाए रखें",+ "toggle": "टॉगल"+ },+ "descriptions": {+ "hold_or_toggle": "रिकॉर्ड करने के लिए दबाए रखें या टॉगल करने के लिए टैप करें",+ "push_to_talk": "जब तक आप शॉर्टकट दबाए रखते हैं, रिकॉर्डिंग होती है",+ "toggle": "रिकॉर्डिंग शुरू करने के लिए शॉर्टकट टैप करें, रोकने के लिए फिर से टैप करें"+ }}},"models": {@@ -553,6 +563,10 @@"title": "पेस्ट में देरी (बाद में)","description": "पेस्ट कीस्ट्रोक के बाद और आपका पिछला क्लिपबोर्ड वापस लाने से पहले की देरी (मिलीसेकंड में). अगर ट्रांसक्रिप्शन की जगह आपके क्लिपबोर्ड का पुराना कॉन्टेंट पेस्ट हो रहा हो, तो इसे बढ़ाएं."},+ "holdThreshold": {+ "title": "दबाए रखने की सीमा",+ "description": "केवल स्वचालित मोड में: शॉर्टकट को कितनी देर (मिलीसेकंड में) दबाए रखना होगा ताकि उसे टैप के बजाय दबाए रखना माना जाए। यदि थोड़ी देर दबाए रखने के बाद भी रिकॉर्डिंग चलती रह जाती है तो इसे कम करें; यदि जानबूझकर किए गए टैप को दबाए रखना मान लिया जाता है तो इसे बढ़ाएँ।"+ },"reliablePaste": {"title": "भरोसेमंद पेस्ट (Beta)","description": "क्लिपबोर्ड को तय देरी के बाद नहीं, बल्कि टारगेट ऐप असल में ट्रांसक्रिप्शन पढ़ लेने के बाद ही वापस लाएं. यह सिस्टम पर लोड होने के दौरान पुराना क्लिपबोर्ड कॉन्टेंट पेस्ट होने की समस्या ठीक करने के लिए है. इसके लिए क्लिपबोर्ड वाला पेस्ट तरीका ज़रूरी है; सिर्फ़ macOS और Windows पर."diff --git a/src/i18n/locales/it/translation.json b/src/i18n/locales/it/translation.jsonindex ed6d2ccd..32581cd1 100644--- a/src/i18n/locales/it/translation.json+++ b/src/i18n/locales/it/translation.json@@ -214,9 +214,19 @@"noResults": "Nessuna lingua trovata","auto": "Automatico"},- "pushToTalk": {- "label": "Premi per Parlare",- "description": "Tieni premuto per parlare, rilascia per interrompere"+ "shortcutActivation": {+ "title": "Comportamento della scorciatoia",+ "description": "Scegli come la scorciatoia di trascrizione avvia e interrompe la registrazione.",+ "options": {+ "holdOrToggle": "Automatico",+ "pushToTalk": "Tieni premuto",+ "toggle": "Alterna"+ },+ "descriptions": {+ "hold_or_toggle": "Tieni premuto per registrare o tocca per alternare",+ "push_to_talk": "Registra finché tieni premuta la scorciatoia",+ "toggle": "Tocca la scorciatoia per avviare la registrazione, tocca di nuovo per fermarla"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Ritardo incolla (dopo)","description": "Ritardo (in millisecondi) dopo il tasto incolla, prima di ripristinare gli appunti precedenti. Aumentare se viene incollato il vecchio contenuto degli appunti invece della trascrizione."},+ "holdThreshold": {+ "title": "Soglia di pressione prolungata",+ "description": "Solo in modalità Automatico: per quanto tempo (in millisecondi) la scorciatoia deve restare premuta per contare come pressione prolungata invece di un tocco. Riduci se la registrazione resta attiva dopo pressioni brevi; aumenta se i tocchi intenzionali vengono interpretati come pressioni prolungate."+ },"reliablePaste": {"title": "Incolla affidabile (Beta)","description": "Ripristina gli appunti solo dopo che l'app di destinazione ha effettivamente letto la trascrizione, anziché dopo un ritardo fisso. Serve a risolvere l'incollaggio del vecchio contenuto degli appunti quando il sistema è sotto carico. Richiede un metodo di incollaggio tramite appunti; solo macOS e Windows."diff --git a/src/i18n/locales/ja/translation.json b/src/i18n/locales/ja/translation.jsonindex 28934462..f4529837 100644--- a/src/i18n/locales/ja/translation.json+++ b/src/i18n/locales/ja/translation.json@@ -214,9 +214,19 @@"noResults": "言語が見つかりません","auto": "自動"},- "pushToTalk": {- "label": "プッシュツートーク",- "description": "押し続けて録音、離して停止"+ "shortcutActivation": {+ "title": "ショートカットの動作",+ "description": "文字起こしのショートカットで録音を開始・停止する方法を選択します。",+ "options": {+ "holdOrToggle": "自動",+ "pushToTalk": "長押し",+ "toggle": "切り替え"+ },+ "descriptions": {+ "hold_or_toggle": "長押しで録音、タップで切り替え",+ "push_to_talk": "ショートカットを押している間だけ録音します",+ "toggle": "ショートカットをタップすると録音を開始し、もう一度タップすると停止します"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "貼り付け遅延(後)","description": "貼り付けキーを送信した後、以前のクリップボードを復元する前の遅延(ミリ秒)。文字起こしではなく古いクリップボードの内容が貼り付けられる場合は増やしてください。"},+ "holdThreshold": {+ "title": "長押しのしきい値",+ "description": "「自動」モードのみ: タップではなく長押しとみなすためにショートカットを押し続ける必要がある時間(ミリ秒)。短い長押しの後も録音が続いてしまう場合は下げ、意図したタップが長押しと判定される場合は上げてください。"+ },"reliablePaste": {"title": "確実な貼り付け(Beta)","description": "固定の遅延ではなく、対象アプリが実際に文字起こしを読み取った後にのみクリップボードを復元します。システム負荷が高いときに古いクリップボードの内容が貼り付けられる問題を解決するための設定です。クリップボードを使う貼り付け方法が必要です。macOS と Windows のみ。"diff --git a/src/i18n/locales/ko/translation.json b/src/i18n/locales/ko/translation.jsonindex 59b6e847..a33ee0d4 100644--- a/src/i18n/locales/ko/translation.json+++ b/src/i18n/locales/ko/translation.json@@ -194,9 +194,19 @@"noResults": "언어를 찾을 수 없습니다","auto": "자동"},- "pushToTalk": {- "label": "녹음 중 단축키 홀딩",- "description": "누르고 있으면 녹음, 놓으면 정지"+ "shortcutActivation": {+ "title": "단축키 동작",+ "description": "음성 텍스트 변환 단축키로 녹음을 시작하고 중지하는 방식을 선택합니다.",+ "options": {+ "holdOrToggle": "자동",+ "pushToTalk": "길게 누르기",+ "toggle": "전환"+ },+ "descriptions": {+ "hold_or_toggle": "길게 누르면 녹음, 탭하면 전환",+ "push_to_talk": "단축키를 누르고 있는 동안 녹음합니다",+ "toggle": "단축키를 탭하면 녹음을 시작하고, 다시 탭하면 중지합니다"+ }}},"sound": {@@ -541,6 +551,10 @@"title": "붙여넣기 지연 (이후)","description": "붙여넣기 키 입력을 보낸 후 이전 클립보드를 복원하기 전의 지연 시간(밀리초). 전사된 텍스트 대신 이전 클립보드 내용이 붙여넣어지면 늘리세요."},+ "holdThreshold": {+ "title": "길게 누르기 기준 시간",+ "description": "자동 모드 전용: 탭이 아닌 길게 누르기로 인식되려면 단축키를 얼마나 오래(밀리초) 누르고 있어야 하는지 설정합니다. 짧게 누른 뒤에도 녹음이 계속 켜져 있으면 낮추고, 의도한 탭이 길게 누르기로 처리되면 높이세요."+ },"reliablePaste": {"title": "안정적인 붙여넣기 (Beta)","description": "고정된 지연 시간이 아니라 대상 앱이 실제로 전사된 텍스트를 읽은 뒤에만 클립보드를 복원합니다. 시스템 부하가 높을 때 이전 클립보드 내용이 붙여넣어지는 문제를 해결하기 위한 옵션입니다. 클립보드를 사용하는 붙여넣기 방법이 필요하며 macOS와 Windows에서만 지원됩니다."diff --git a/src/i18n/locales/ne/translation.json b/src/i18n/locales/ne/translation.jsonindex 950c5462..a57096a7 100644--- a/src/i18n/locales/ne/translation.json+++ b/src/i18n/locales/ne/translation.json@@ -194,9 +194,19 @@"noResults": "कुनै भाषा भेटिएन","auto": "स्वतः"},- "pushToTalk": {- "label": "पुश टु टक",- "description": "रेकर्ड गर्न थिचिराख्नुहोस्, रोक्न छोड्नुहोस्"+ "shortcutActivation": {+ "title": "सर्टकटको व्यवहार",+ "description": "ट्रान्सक्राइब सर्टकटले रेकर्डिङ सुरु र बन्द गर्ने तरिका छान्नुहोस्।",+ "options": {+ "holdOrToggle": "स्वचालित",+ "pushToTalk": "थिचिराख्नुहोस्",+ "toggle": "टगल"+ },+ "descriptions": {+ "hold_or_toggle": "रेकर्ड गर्न थिचिराख्नुहोस् वा टगल गर्न ट्याप गर्नुहोस्",+ "push_to_talk": "सर्टकट थिचिराखेसम्म रेकर्ड गर्छ",+ "toggle": "रेकर्डिङ सुरु गर्न सर्टकट ट्याप गर्नुहोस्, रोक्न फेरि ट्याप गर्नुहोस्"+ }}},"models": {@@ -553,6 +563,10 @@"title": "पेस्ट ढिलाइ (पछि)","description": "पेस्ट किस्ट्रोकपछि, तपाईंको अघिल्लो क्लिपबोर्ड पुनर्स्थापना गर्नुअघिको ढिलाइ (मिलिसेकेन्डमा)। ट्रान्सक्रिप्सनको सट्टा पुरानो क्लिपबोर्ड सामग्री पेस्ट भइरहेको छ भने बढाउनुहोस्।"},+ "holdThreshold": {+ "title": "थिचिराख्ने सीमा",+ "description": "स्वचालित मोडमा मात्र: ट्यापको सट्टा थिचिराखेको मानिनका लागि सर्टकट कति समय (मिलिसेकेन्डमा) थिचिराख्नुपर्छ। छोटो समय थिचिराखेपछि पनि रेकर्डिङ चलिरह्यो भने घटाउनुहोस्; जानाजानी गरिएका ट्यापहरू थिचिराखेको रूपमा लिइए भने बढाउनुहोस्।"+ },"reliablePaste": {"title": "भरपर्दो पेस्ट (Beta)","description": "निश्चित ढिलाइपछि नभई, लक्षित एपले ट्रान्सक्रिप्सन साँच्चै पढेपछि मात्र क्लिपबोर्ड पुनर्स्थापना गर्नुहोस्। प्रणालीमा भार बढ्दा पुरानो क्लिपबोर्ड सामग्री पेस्ट हुने समस्या समाधान गर्न बनाइएको। क्लिपबोर्ड प्रयोग गर्ने पेस्ट विधि आवश्यक; macOS र Windows मा मात्र।"diff --git a/src/i18n/locales/nl/translation.json b/src/i18n/locales/nl/translation.jsonindex 391f9f53..0dcbfff9 100644--- a/src/i18n/locales/nl/translation.json+++ b/src/i18n/locales/nl/translation.json@@ -194,9 +194,19 @@"noResults": "Geen talen gevonden","auto": "Automatisch"},- "pushToTalk": {- "label": "Push-to-talk",- "description": "Ingedrukt houden om op te nemen, loslaten om te stoppen"+ "shortcutActivation": {+ "title": "Gedrag van sneltoets",+ "description": "Kies hoe de sneltoets voor dicteren de opname start en stopt.",+ "options": {+ "holdOrToggle": "Automatisch",+ "pushToTalk": "Vasthouden",+ "toggle": "Schakelen"+ },+ "descriptions": {+ "hold_or_toggle": "Houd ingedrukt om op te nemen of tik om te schakelen",+ "push_to_talk": "Neemt op zolang je de sneltoets ingedrukt houdt",+ "toggle": "Tik op de sneltoets om de opname te starten, tik opnieuw om te stoppen"+ }}},"models": {@@ -553,6 +563,10 @@"title": "Plakvertraging (na)","description": "Vertraging (in milliseconden) na de plak-toetsaanslag, voordat je vorige klembord wordt hersteld. Verhoog dit als de oude klembordinhoud wordt geplakt in plaats van de transcriptie."},+ "holdThreshold": {+ "title": "Vasthouddrempel",+ "description": "Alleen in de modus Automatisch: hoe lang (in milliseconden) de sneltoets ingedrukt moet blijven om als vasthouden te tellen in plaats van als tik. Verlaag dit als de opname na kort vasthouden blijft doorlopen; verhoog het als bewuste tikken als vasthouden worden gezien."+ },"reliablePaste": {"title": "Betrouwbaar plakken (Beta)","description": "Herstel het klembord pas nadat de doelapp de transcriptie daadwerkelijk heeft gelezen, in plaats van na een vaste vertraging. Bedoeld om te verhelpen dat bij systeembelasting de oude klembordinhoud wordt geplakt. Vereist een plakmethode via het klembord; alleen macOS en Windows."diff --git a/src/i18n/locales/pl/translation.json b/src/i18n/locales/pl/translation.jsonindex baa675cb..71f9712e 100644--- a/src/i18n/locales/pl/translation.json+++ b/src/i18n/locales/pl/translation.json@@ -214,9 +214,19 @@"noResults": "Nie znaleziono języków","auto": "Automatycznie"},- "pushToTalk": {- "label": "Naciśnij i mów",- "description": "Przytrzymaj, aby nagrywać, puść, aby zatrzymać"+ "shortcutActivation": {+ "title": "Zachowanie skrótu",+ "description": "Wybierz, jak skrót transkrypcji rozpoczyna i zatrzymuje nagrywanie.",+ "options": {+ "holdOrToggle": "Automatycznie",+ "pushToTalk": "Przytrzymaj",+ "toggle": "Przełączaj"+ },+ "descriptions": {+ "hold_or_toggle": "Przytrzymaj, aby nagrywać, lub dotknij, aby przełączyć",+ "push_to_talk": "Nagrywa, dopóki trzymasz skrót",+ "toggle": "Dotknij skrótu, aby rozpocząć nagrywanie, dotknij ponownie, aby zatrzymać"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Opóźnienie wklejania (po)","description": "Opóźnienie (w milisekundach) po klawiszu wklejania, przed przywróceniem poprzedniego schowka. Zwiększ, jeśli zamiast transkrypcji wklejana jest stara zawartość schowka."},+ "holdThreshold": {+ "title": "Próg przytrzymania",+ "description": "Tylko w trybie automatycznym: jak długo (w milisekundach) skrót musi być przytrzymany, aby liczył się jako przytrzymanie, a nie dotknięcie. Zmniejsz, jeśli po krótkim przytrzymaniu nagrywanie pozostaje włączone; zwiększ, jeśli celowe dotknięcia są traktowane jako przytrzymanie."+ },"reliablePaste": {"title": "Niezawodne wklejanie (Beta)","description": "Przywracaj schowek dopiero po tym, jak docelowa aplikacja faktycznie odczyta transkrypcję, a nie po ustalonym opóźnieniu. Ma naprawić wklejanie starej zawartości schowka przy obciążeniu systemu. Wymaga metody wklejania przez schowek; tylko macOS i Windows."diff --git a/src/i18n/locales/pt/translation.json b/src/i18n/locales/pt/translation.jsonindex b53f09f4..228752cd 100644--- a/src/i18n/locales/pt/translation.json+++ b/src/i18n/locales/pt/translation.json@@ -194,9 +194,19 @@"noResults": "Nenhum idioma encontrado","auto": "Automático"},- "pushToTalk": {- "label": "Pressionar para Falar",- "description": "Segure para gravar, solte para parar"+ "shortcutActivation": {+ "title": "Comportamento do atalho",+ "description": "Escolha como o atalho de transcrição inicia e para a gravação.",+ "options": {+ "holdOrToggle": "Automático",+ "pushToTalk": "Segurar",+ "toggle": "Alternar"+ },+ "descriptions": {+ "hold_or_toggle": "Segure para gravar ou toque para alternar",+ "push_to_talk": "Grava enquanto você mantém o atalho pressionado",+ "toggle": "Toque no atalho para começar a gravar, toque novamente para parar"+ }}},"models": {@@ -546,6 +556,10 @@"title": "Atraso de colagem (depois)","description": "Atraso (em milissegundos) após a tecla de colar, antes de restaurar a área de transferência anterior. Aumente se o conteúdo antigo da área de transferência estiver sendo colado em vez da transcrição."},+ "holdThreshold": {+ "title": "Limite de tempo de pressão",+ "description": "Apenas no modo Automático: por quanto tempo (em milissegundos) o atalho precisa ficar pressionado para contar como segurar em vez de um toque. Diminua se a gravação continuar ativa após pressões curtas; aumente se toques intencionais forem tratados como segurar."+ },"reliablePaste": {"title": "Colagem confiável (Beta)","description": "Restaura a área de transferência somente depois que o aplicativo de destino realmente lê a transcrição, em vez de após um atraso fixo. Serve para corrigir a colagem do conteúdo antigo da área de transferência quando o sistema está sobrecarregado. Requer um método de colar via área de transferência; apenas macOS e Windows."diff --git a/src/i18n/locales/ru/translation.json b/src/i18n/locales/ru/translation.jsonindex 0a2429b3..c00665f3 100644--- a/src/i18n/locales/ru/translation.json+++ b/src/i18n/locales/ru/translation.json@@ -214,9 +214,19 @@"noResults": "Языки не найдены","auto": "Авто"},- "pushToTalk": {- "label": "Нажми и говори",- "description": "Удерживайте, чтобы записать, отпустите, чтобы остановить"+ "shortcutActivation": {+ "title": "Поведение сочетания клавиш",+ "description": "Выберите, как горячая клавиша транскрипции запускает и останавливает запись.",+ "options": {+ "holdOrToggle": "Автоматически",+ "pushToTalk": "Удержание",+ "toggle": "Переключение"+ },+ "descriptions": {+ "hold_or_toggle": "Удерживайте для записи или нажмите кратко для переключения",+ "push_to_talk": "Записывает, пока сочетание клавиш удерживается",+ "toggle": "Нажмите сочетание клавиш, чтобы начать запись, нажмите ещё раз, чтобы остановить"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Задержка вставки (после)","description": "Задержка (в миллисекундах) после нажатия клавиши вставки, перед восстановлением предыдущего буфера обмена. Увеличьте, если вместо транскрипции вставляется старое содержимое буфера обмена."},+ "holdThreshold": {+ "title": "Порог удержания",+ "description": "Только для автоматического режима: сколько (в миллисекундах) нужно удерживать сочетание клавиш, чтобы это считалось удержанием, а не кратким нажатием. Уменьшите, если после короткого удержания запись продолжается; увеличьте, если намеренные краткие нажатия воспринимаются как удержание."+ },"reliablePaste": {"title": "Надёжная вставка (Beta)","description": "Восстанавливать буфер обмена только после того, как целевое приложение действительно прочитает транскрипцию, а не по фиксированной задержке. Предназначено для устранения вставки старого содержимого буфера обмена при нагрузке на систему. Требуется метод вставки через буфер обмена; только macOS и Windows."diff --git a/src/i18n/locales/sv/translation.json b/src/i18n/locales/sv/translation.jsonindex a521d43d..0125f35f 100644--- a/src/i18n/locales/sv/translation.json+++ b/src/i18n/locales/sv/translation.json@@ -194,9 +194,19 @@"noResults": "Inga språk hittades","auto": "Automatiskt"},- "pushToTalk": {- "label": "Tryck för att tala",- "description": "Håll ned för att spela in, släpp för att stoppa"+ "shortcutActivation": {+ "title": "Genvägens beteende",+ "description": "Välj hur kortkommandot för transkribering startar och stoppar inspelningen.",+ "options": {+ "holdOrToggle": "Automatiskt",+ "pushToTalk": "Håll",+ "toggle": "Växla"+ },+ "descriptions": {+ "hold_or_toggle": "Håll nere för att spela in eller tryck kort för att växla",+ "push_to_talk": "Spelar in så länge du håller genvägen nedtryckt",+ "toggle": "Tryck på genvägen för att starta inspelningen, tryck igen för att stoppa"+ }}},"models": {@@ -546,6 +556,10 @@"title": "Fördröjning vid klistra in (efter)","description": "Fördröjning (i millisekunder) efter tangenttryckningen för att klistra in, innan ditt tidigare urklipp återställs. Öka om det gamla urklippsinnehållet klistras in i stället för transkriptionen."},+ "holdThreshold": {+ "title": "Tröskel för hållning",+ "description": "Endast i automatiskt läge: hur länge (i millisekunder) genvägen måste hållas nere för att räknas som hållning i stället för ett tryck. Sänk värdet om inspelningen fortsätter efter korta hållningar; höj det om avsiktliga tryck tolkas som hållning."+ },"reliablePaste": {"title": "Tillförlitlig inklistring (Beta)","description": "Återställ urklipp först när målappen faktiskt har läst transkriptionen, i stället för efter en fast fördröjning. Avsett att åtgärda att det gamla urklippsinnehållet klistras in när systemet är belastat. Kräver en klistra-in-metod via urklipp; endast macOS och Windows."diff --git a/src/i18n/locales/tr/translation.json b/src/i18n/locales/tr/translation.jsonindex 235d17cc..2817669d 100644--- a/src/i18n/locales/tr/translation.json+++ b/src/i18n/locales/tr/translation.json@@ -214,9 +214,19 @@"noResults": "Dil bulunamadı","auto": "Otomatik"},- "pushToTalk": {- "label": "Bas Konuş",- "description": "Kaydetmek için basılı tutun, durdurmak için bırakın"+ "shortcutActivation": {+ "title": "Kısayol davranışı",+ "description": "Transkripsiyon kısayolunun kaydı nasıl başlatıp durduracağını seçin.",+ "options": {+ "holdOrToggle": "Otomatik",+ "pushToTalk": "Basılı tut",+ "toggle": "Aç/Kapat"+ },+ "descriptions": {+ "hold_or_toggle": "Kaydetmek için basılı tutun veya açıp kapatmak için dokunun",+ "push_to_talk": "Kısayolu basılı tuttuğunuz sürece kaydeder",+ "toggle": "Kaydı başlatmak için kısayola dokunun, durdurmak için tekrar dokunun"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Yapıştırma Gecikmesi (Sonra)","description": "Yapıştırma tuşundan sonra, önceki panonuz geri yüklenmeden önceki gecikme (milisaniye cinsinden). Transkripsiyon yerine eski pano içeriği yapıştırılıyorsa artırın."},+ "holdThreshold": {+ "title": "Basılı tutma eşiği",+ "description": "Yalnızca Otomatik modda: kısayolun dokunma yerine basılı tutma sayılması için ne kadar süre (milisaniye) basılı tutulması gerektiği. Kısa basılı tutmalardan sonra kayıt açık kalmaya devam ediyorsa azaltın; bilinçli dokunmalar basılı tutma olarak algılanıyorsa artırın."+ },"reliablePaste": {"title": "Güvenilir Yapıştırma (Beta)","description": "Panoyu sabit bir gecikmenin ardından değil, hedef uygulama transkripsiyonu gerçekten okuduktan sonra geri yükler. Sistem yükü altında eski pano içeriğinin yapıştırılması sorununu gidermeyi amaçlar. Pano üzerinden çalışan bir yapıştırma yöntemi gerektirir; yalnızca macOS ve Windows."diff --git a/src/i18n/locales/uk/translation.json b/src/i18n/locales/uk/translation.jsonindex 284e5c6c..c96ff142 100644--- a/src/i18n/locales/uk/translation.json+++ b/src/i18n/locales/uk/translation.json@@ -194,9 +194,19 @@"noResults": "Мов не знайдено","auto": "Авто"},- "pushToTalk": {- "label": "Утримувати для запису (Push To Talk)",- "description": "Утримуйте для запису, відпустіть для зупинки"+ "shortcutActivation": {+ "title": "Поведінка комбінації клавіш",+ "description": "Виберіть, як гаряча клавіша транскрипції запускає та зупиняє запис.",+ "options": {+ "holdOrToggle": "Автоматично",+ "pushToTalk": "Утримання",+ "toggle": "Перемикання"+ },+ "descriptions": {+ "hold_or_toggle": "Утримуйте для запису або натисніть коротко для перемикання",+ "push_to_talk": "Записує, поки комбінація клавіш утримується",+ "toggle": "Натисніть комбінацію клавіш, щоб почати запис, натисніть ще раз, щоб зупинити"+ }}},"models": {@@ -546,6 +556,10 @@"title": "Затримка вставки (після)","description": "Затримка (у мілісекундах) після натискання клавіші вставки, перед відновленням попереднього буфера обміну. Збільшіть, якщо замість транскрипції вставляється старий вміст буфера обміну."},+ "holdThreshold": {+ "title": "Поріг утримання",+ "description": "Лише для автоматичного режиму: скільки (у мілісекундах) потрібно утримувати комбінацію клавіш, щоб це вважалося утриманням, а не коротким натисканням. Зменште, якщо після короткого утримання запис триває; збільште, якщо навмисні короткі натискання сприймаються як утримання."+ },"reliablePaste": {"title": "Надійна вставка (Beta)","description": "Відновлювати буфер обміну лише після того, як цільова програма справді прочитає транскрипцію, а не через фіксовану затримку. Призначено для усунення вставки старого вмісту буфера обміну під навантаженням на систему. Потрібен метод вставки через буфер обміну; лише macOS і Windows."diff --git a/src/i18n/locales/vi/translation.json b/src/i18n/locales/vi/translation.jsonindex e5d0b5ed..be4a4440 100644--- a/src/i18n/locales/vi/translation.json+++ b/src/i18n/locales/vi/translation.json@@ -214,9 +214,19 @@"noResults": "Không tìm thấy ngôn ngữ","auto": "Tự động"},- "pushToTalk": {- "label": "Nhấn để nói",- "description": "Giữ để ghi âm, thả để dừng"+ "shortcutActivation": {+ "title": "Hành vi phím tắt",+ "description": "Chọn cách phím tắt chuyển đổi bắt đầu và dừng ghi âm.",+ "options": {+ "holdOrToggle": "Tự động",+ "pushToTalk": "Giữ",+ "toggle": "Bật/tắt"+ },+ "descriptions": {+ "hold_or_toggle": "Giữ để ghi âm hoặc nhấn nhanh để bật/tắt",+ "push_to_talk": "Ghi âm trong lúc bạn giữ phím tắt",+ "toggle": "Nhấn phím tắt để bắt đầu ghi âm, nhấn lại để dừng"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "Độ trễ dán (sau)","description": "Độ trễ (tính bằng mili giây) sau khi gửi phím dán, trước khi khôi phục bảng nhớ tạm trước đó. Tăng nếu nội dung bảng nhớ tạm cũ được dán thay vì bản chép lời."},+ "holdThreshold": {+ "title": "Ngưỡng giữ phím",+ "description": "Chỉ áp dụng cho chế độ Tự động: phím tắt phải được giữ trong bao lâu (mili giây) để được tính là giữ thay vì nhấn nhanh. Giảm xuống nếu bản ghi vẫn tiếp tục sau khi giữ ngắn; tăng lên nếu các lần nhấn nhanh có chủ ý bị coi là giữ phím."+ },"reliablePaste": {"title": "Dán đáng tin cậy (Beta)","description": "Chỉ khôi phục bảng nhớ tạm sau khi ứng dụng đích thực sự đọc bản chép lời, thay vì sau một độ trễ cố định. Nhằm khắc phục việc nội dung bảng nhớ tạm cũ bị dán khi hệ thống bị tải nặng. Cần một phương thức dán qua bảng nhớ tạm; chỉ dành cho macOS và Windows."diff --git a/src/i18n/locales/zh-TW/translation.json b/src/i18n/locales/zh-TW/translation.jsonindex 9ba3b176..8278cdf0 100644--- a/src/i18n/locales/zh-TW/translation.json+++ b/src/i18n/locales/zh-TW/translation.json@@ -194,9 +194,19 @@"noResults": "未找到語言","auto": "自動"},- "pushToTalk": {- "label": "按住說話",- "description": "按住錄製,放開停止"+ "shortcutActivation": {+ "title": "快捷鍵行為",+ "description": "選擇轉錄快捷鍵開始和停止錄音的方式。",+ "options": {+ "holdOrToggle": "自動",+ "pushToTalk": "按住",+ "toggle": "切換"+ },+ "descriptions": {+ "hold_or_toggle": "按住錄音,或輕按切換",+ "push_to_talk": "按住快捷鍵期間錄音",+ "toggle": "輕按快捷鍵開始錄音,再次輕按停止"+ }}},"models": {@@ -546,6 +556,10 @@"title": "貼上延遲(後)","description": "發送貼上按鍵後、還原先前剪貼簿前的延遲(毫秒)。如果貼上的是舊的剪貼簿內容而非轉錄文字,請增加此值。"},+ "holdThreshold": {+ "title": "長按判定時長",+ "description": "僅適用於「自動」模式:快捷鍵需要按住多久(毫秒)才算作按住而不是輕按。如果短暫按住後錄音仍持續,請調低;如果刻意的輕按被視為按住,請調高。"+ },"reliablePaste": {"title": "可靠貼上(Beta)","description": "在目標應用程式真正讀取轉錄文字之後才還原剪貼簿,而不是等待固定延遲。用於解決系統負載較高時貼上舊剪貼簿內容的問題。需要使用剪貼簿類的貼上方式;僅支援 macOS 與 Windows。"diff --git a/src/i18n/locales/zh/translation.json b/src/i18n/locales/zh/translation.jsonindex 11664e95..99bd0157 100644--- a/src/i18n/locales/zh/translation.json+++ b/src/i18n/locales/zh/translation.json@@ -214,9 +214,19 @@"noResults": "未找到语言","auto": "自动"},- "pushToTalk": {- "label": "按住说话",- "description": "按住录制,松开停止"+ "shortcutActivation": {+ "title": "快捷键行为",+ "description": "选择转录快捷键开始和停止录音的方式。",+ "options": {+ "holdOrToggle": "自动",+ "pushToTalk": "按住",+ "toggle": "切换"+ },+ "descriptions": {+ "hold_or_toggle": "按住录音,或轻按切换",+ "push_to_talk": "按住快捷键期间录音",+ "toggle": "轻按快捷键开始录音,再次轻按停止"+ }}},"sound": {@@ -546,6 +556,10 @@"title": "粘贴延迟(后)","description": "发送粘贴按键后、恢复先前剪贴板前的延迟(毫秒)。如果粘贴的是旧的剪贴板内容而非转录文本,请增加此值。"},+ "holdThreshold": {+ "title": "长按判定时长",+ "description": "仅适用于“自动”模式:快捷键需要按住多长时间(毫秒)才算作按住而不是轻按。如果短暂按住后录音仍持续,请调低;如果有意的轻按被当作按住,请调高。"+ },"reliablePaste": {"title": "可靠粘贴(Beta)","description": "在目标应用程序真正读取转录文本之后再恢复剪贴板,而不是等待固定延迟。用于解决系统负载较高时粘贴旧剪贴板内容的问题。需要使用剪贴板类的粘贴方式;仅支持 macOS 和 Windows。"diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.tsindex 9ea4ba49..fbbf5193 100644--- a/src/stores/settingsStore.ts+++ b/src/stores/settingsStore.ts@@ -6,6 +6,7 @@ import type {AudioDevice,TranscribeAcceleratorSetting,OrtAcceleratorSetting,+ ShortcutActivation,VadBackend,} from "@/bindings";import { commands } from "@/bindings";@@ -97,7 +98,10 @@ const settingUpdaters: {commands.changeShowWhatsNewOnUpdateSetting(value as boolean),whats_new_last_seen_version: (value) =>commands.changeWhatsNewLastSeenVersionSetting(value as string),- push_to_talk: (value) => commands.changePttSetting(value as boolean),+ shortcut_activation: (value) =>+ commands.changeShortcutActivationSetting(value as ShortcutActivation),+ hold_threshold_ms: (value) =>+ commands.changeHoldThresholdMsSetting(value as number),selected_microphone: (value) =>commands.setSelectedMicrophone((value as string) === "Default" || value === null