Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

fix(paste): release the modifier keys after pasting with wtype (#1487)

Yan Li0f32df744532
diff --git a/src-tauri/src/clipboard.rs b/src-tauri/src/clipboard.rs
index 5a181345..01b60f66 100644
--- a/src-tauri/src/clipboard.rs
+++ b/src-tauri/src/clipboard.rs
@@ -427,9 +427,11 @@ fn write_clipboard_via_wl_copy(text: &str) -> Result<(), String> {
#[cfg(target_os = "linux")]
fn send_key_combo_via_wtype(paste_method: &PasteMethod) -> Result<(), String> {
let args: Vec<&str> = match paste_method {
- PasteMethod::CtrlV => vec!["-M", "ctrl", "-k", "v"],
- PasteMethod::ShiftInsert => vec!["-M", "shift", "-k", "Insert"],
- PasteMethod::CtrlShiftV => vec!["-M", "ctrl", "-M", "shift", "-k", "v"],
+ PasteMethod::CtrlV => vec!["-M", "ctrl", "-k", "v", "-m", "ctrl"],
+ PasteMethod::ShiftInsert => vec!["-M", "shift", "-k", "Insert", "-m", "shift"],
+ PasteMethod::CtrlShiftV => vec![
+ "-M", "ctrl", "-M", "shift", "-k", "v", "-m", "shift", "-m", "ctrl",
+ ],
_ => return Err("Unsupported paste method".into()),
};