feat(engine): implement toggle event

This commit is contained in:
Federico Terzi 2021-10-31 16:30:52 +01:00
parent 4d3b1a5a59
commit 70d97bf90d
2 changed files with 5 additions and 0 deletions

View File

@ -82,6 +82,7 @@ pub enum EventType {
Enabled, Enabled,
DisableRequest, DisableRequest,
EnableRequest, EnableRequest,
ToggleRequest,
SecureInputEnabled(internal::SecureInputEnabledEvent), SecureInputEnabled(internal::SecureInputEnabledEvent),
SecureInputDisabled, SecureInputDisabled,

View File

@ -93,6 +93,10 @@ impl Middleware for DisableMiddleware {
*enabled = false; *enabled = false;
has_status_changed = true; has_status_changed = true;
} }
EventType::ToggleRequest => {
*enabled = !*enabled;
has_status_changed = true;
}
_ => {} _ => {}
} }