From 4068f5ac66effba9e2674dad913190eae5885877 Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sat, 8 May 2021 14:02:30 +0200 Subject: [PATCH] fix(inject): export options fields and change macos default delay --- espanso-inject/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/espanso-inject/src/lib.rs b/espanso-inject/src/lib.rs index e1fa991..3532ee5 100644 --- a/espanso-inject/src/lib.rs +++ b/espanso-inject/src/lib.rs @@ -50,12 +50,12 @@ pub trait Injector { #[allow(dead_code)] pub struct InjectionOptions { // Delay between injected events - delay: i32, + pub delay: i32, // Use original libxdo methods instead of patched version // using XSendEvent rather than XTestFakeKeyEvent // NOTE: Only relevant on X11 linux systems. - disable_fast_inject: bool, + pub disable_fast_inject: bool, } impl Default for InjectionOptions { @@ -63,7 +63,7 @@ impl Default for InjectionOptions { let default_delay = if cfg!(target_os = "windows") { 0 } else if cfg!(target_os = "macos") { - 2 + 1 } else if cfg!(target_os = "linux") { if cfg!(feature = "wayland") { 1 @@ -84,19 +84,19 @@ impl Default for InjectionOptions { #[allow(dead_code)] pub struct InjectorCreationOptions { // Only relevant in X11 Linux systems, use the EVDEV backend instead of X11. - use_evdev: bool, + pub use_evdev: bool, // Overwrite the list of modifiers to be scanned when // populating the evdev injector lookup maps - evdev_modifiers: Option>, + pub evdev_modifiers: Option>, // Overwrite the maximum number of modifiers used tested in // a single combination to populate the lookup maps - evdev_max_modifier_combination_len: Option, + pub evdev_max_modifier_combination_len: Option, // Can be used to overwrite the keymap configuration // used by espanso to inject key presses. - evdev_keyboard_rmlvo: Option, + pub evdev_keyboard_rmlvo: Option, } // This struct identifies the keyboard layout that