Merge pull request from NickSeagull/master

Allow turning the toggle key off
This commit is contained in:
Federico Terzi 2019-11-25 13:00:59 +01:00 committed by GitHub
commit 4c32a37854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions
src
event
matcher

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) {