Keyboard shortcuts
This commit is contained in:
@@ -21,5 +21,55 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
{
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
override func buildMenu(with builder: UIMenuBuilder) {
|
||||
let fileCommands = [
|
||||
// Open Location...
|
||||
UIKeyCommand(
|
||||
modifiers: .command, input: "L",
|
||||
title: "Open Location",
|
||||
action: #selector(ShortcutResponder.focusURLBar)
|
||||
),
|
||||
|
||||
// Go Back
|
||||
UIKeyCommand(
|
||||
modifiers: .command, input: "[",
|
||||
title: "Go Back",
|
||||
action: #selector(ShortcutResponder.goBack)
|
||||
),
|
||||
|
||||
// Go Forward
|
||||
UIKeyCommand(
|
||||
modifiers: .command, input: "]",
|
||||
title: "Go Forward",
|
||||
action: #selector(ShortcutResponder.goForward)
|
||||
),
|
||||
|
||||
// Create Tab
|
||||
UIKeyCommand(
|
||||
modifiers: .command, input: "T",
|
||||
title: "New Tab",
|
||||
action: #selector(ShortcutResponder.createTab)
|
||||
),
|
||||
|
||||
// Previous Tab
|
||||
UIKeyCommand(
|
||||
modifiers: [.command, .shift], input: "[",
|
||||
title: "Previous Tab",
|
||||
action: #selector(ShortcutResponder.previousTab)
|
||||
),
|
||||
|
||||
// Next Tab
|
||||
UIKeyCommand(
|
||||
modifiers: [.command, .shift], input: "]",
|
||||
title: "Next Tab",
|
||||
action: #selector(ShortcutResponder.nextTab)
|
||||
),
|
||||
]
|
||||
|
||||
builder.replaceChildren(ofMenu: .file) { children in
|
||||
return fileCommands + children
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user