/*
* This file is part of espanso.
*
* Copyright (C) 2019-2021 Federico Terzi
*
* espanso is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* espanso is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with espanso. If not, see .
*/
use std::{
cell::RefCell,
time::{Duration, Instant},
};
use log::info;
use super::super::Middleware;
use crate::event::{
input::{Key, KeyboardEvent, Status, Variant},
Event, EventType,
};
pub struct DisableOptions {
pub toggle_key: Option,
pub toggle_key_variant: Option,
pub toggle_key_maximum_window: Duration,
// TODO: toggle shortcut?
}
pub struct DisableMiddleware {
enabled: RefCell,
last_toggle_press: RefCell