Keyboard shortcuts: Support for iPad too
This commit is contained in:
@@ -22,8 +22,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func buildMenu(with builder: UIMenuBuilder) {
|
static func fileMenuShortcuts() -> [UIKeyCommand] {
|
||||||
let fileCommands = [
|
[
|
||||||
// Open Location...
|
// Open Location...
|
||||||
UIKeyCommand(
|
UIKeyCommand(
|
||||||
modifiers: .command, input: "L",
|
modifiers: .command, input: "L",
|
||||||
@@ -66,9 +66,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
action: #selector(ShortcutResponder.nextTab)
|
action: #selector(ShortcutResponder.nextTab)
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
override var keyCommands: [UIKeyCommand]? {
|
||||||
|
get { return Self.fileMenuShortcuts() }
|
||||||
|
}
|
||||||
|
|
||||||
|
override func buildMenu(with builder: UIMenuBuilder) {
|
||||||
builder.replaceChildren(ofMenu: .file) { children in
|
builder.replaceChildren(ofMenu: .file) { children in
|
||||||
return fileCommands + children
|
return Self.fileMenuShortcuts() + children
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user