Allow turning the toggle key off

This commit is contained in:
Nikita Tchayka 2019-11-24 21:55:55 +00:00
parent 6d1f157084
commit 746957c65c
2 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,7 @@ pub enum KeyModifier {
ALT,
META,
BACKSPACE,
OFF,
}
impl Default for KeyModifier {

View File

@ -194,6 +194,7 @@ impl <'a, R: MatchReceiver, M: ConfigManager<'a>> super::Matcher for ScrollingMa
let config = self.config_manager.default_config();
if m == config.toggle_key {
if m == KeyModifier::OFF { return }
let mut toggle_press_time = self.toggle_press_time.borrow_mut();
if let Ok(elapsed) = toggle_press_time.elapsed() {
if elapsed.as_millis() < u128::from(config.toggle_interval) {