Avoid Esc shortcut to close Servo (#32603)

* Avoid Esc shortcut to close Servo

Keep Esc shortcut to leave fullscreen, but avoid to close Servo
(as this is not common in other similar apps,
and can be shortcut used in some web apps for other things).

* Send Esc to the page
This commit is contained in:
Manuel Rego Casasnovas 2024-06-27 05:43:05 +02:00 committed by GitHub
parent aa99c85645
commit 574a22a6cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -186,7 +186,8 @@ Run Servo with the command:
- `Ctrl`+`=` zooms in (`Cmd`+`=` on Mac)
- `Alt`+`left arrow` goes backwards in the history (`Cmd`+`left arrow` on Mac)
- `Alt`+`right arrow` goes forwards in the history (`Cmd`+`right arrow` on Mac)
- `Esc` or `Ctrl`+`Q` exits Servo (`Cmd`+`Q` on Mac)
- `Ctrl`+`Q` exits Servo (`Cmd`+`Q` on Mac)
- `Esc` exits fullscreen
### Runtime dependencies

View file

@ -343,7 +343,7 @@ where
self.event_queue.push(event);
}
} else {
self.event_queue.push(EmbedderEvent::Quit);
self.platform_handle_key(key_event.clone());
}
})
.otherwise(|| self.platform_handle_key(key_event));