feat(core): implement active backend detection
This commit is contained in:
parent
fddb2711e4
commit
e3eecf0555
|
@ -104,9 +104,13 @@ impl<'a> ConfigProvider<'a> for ConfigManager<'a> {
|
||||||
|
|
||||||
impl<'a> ModeProvider for ConfigManager<'a> {
|
impl<'a> ModeProvider for ConfigManager<'a> {
|
||||||
fn active_mode(&self) -> crate::engine::dispatch::Mode {
|
fn active_mode(&self) -> crate::engine::dispatch::Mode {
|
||||||
// TODO: implement the actual active mode detection starting from the active config
|
let config = self.active();
|
||||||
crate::engine::dispatch::Mode::Auto {
|
match config.backend() {
|
||||||
clipboard_threshold: 100
|
espanso_config::config::Backend::Inject => crate::engine::dispatch::Mode::Event,
|
||||||
|
espanso_config::config::Backend::Clipboard => crate::engine::dispatch::Mode::Clipboard,
|
||||||
|
espanso_config::config::Backend::Auto => crate::engine::dispatch::Mode::Auto {
|
||||||
|
clipboard_threshold: config.clipboard_threshold(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user