diff --git a/src/engine.rs b/src/engine.rs index a2b702b..ee6e9c5 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -189,7 +189,9 @@ impl <'a, S: KeyboardManager, C: ClipboardManager, M: ConfigManager<'a>, U: UIMa None }; - let backend = if config.backend == BackendType::Auto { + let backend = if m.force_clipboard { + &BackendType::Clipboard + }else if config.backend == BackendType::Auto { if cfg!(target_os = "linux") { let all_ascii = target_string.chars().all(|c| c.is_ascii()); if all_ascii { diff --git a/src/matcher/mod.rs b/src/matcher/mod.rs index 4356c34..d1f88e8 100644 --- a/src/matcher/mod.rs +++ b/src/matcher/mod.rs @@ -34,6 +34,7 @@ pub struct Match { pub word: bool, pub passive_only: bool, pub propagate_case: bool, + pub force_clipboard: bool, // Automatically calculated from the triggers, used by the matcher to check for correspondences. #[serde(skip_serializing)] @@ -170,6 +171,7 @@ impl<'a> From<&'a AutoMatch> for Match{ passive_only: other.passive_only, _trigger_sequences: trigger_sequences, propagate_case: other.propagate_case, + force_clipboard: other.force_clipboard, } } } @@ -200,6 +202,9 @@ struct AutoMatch { #[serde(default = "default_propagate_case")] pub propagate_case: bool, + + #[serde(default = "default_force_clipboard")] + pub force_clipboard: bool, } fn default_trigger() -> String {"".to_owned()} @@ -210,6 +215,7 @@ fn default_passive_only() -> bool {false} fn default_replace() -> Option {None} fn default_image_path() -> Option {None} fn default_propagate_case() -> bool {false} +fn default_force_clipboard() -> bool {false} #[derive(Debug, Serialize, Deserialize, Clone)] pub struct MatchVariable {