Merge pull request #681 from j-f1/there-is-no-escape

Allow pressing escape to close the media viewer
This commit is contained in:
Nathan Mattes 2022-12-21 21:17:27 +01:00 committed by GitHub
commit fba444d82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -359,12 +359,12 @@ extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
extension MediaPreviewViewController {
var closeKeyCommand: UIKeyCommand {
func closeKeyCommand(input: String) -> UIKeyCommand {
UIKeyCommand(
title: L10n.Scene.Preview.Keyboard.closePreview,
image: nil,
action: #selector(MediaPreviewViewController.closePreviewKeyCommandHandler(_:)),
input: "i",
input: input,
modifierFlags: [],
propertyList: nil,
alternates: [],
@ -408,7 +408,8 @@ extension MediaPreviewViewController {
override var keyCommands: [UIKeyCommand] {
return [
closeKeyCommand,
closeKeyCommand(input: UIKeyCommand.inputEscape),
closeKeyCommand(input: "i"),
showNextKeyCommand,
showPreviousKeyCommand,
]