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,
DisableRequest,
EnableRequest,
ToggleRequest,
SecureInputEnabled(internal::SecureInputEnabledEvent),
SecureInputDisabled,

View File

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