Adds keyboard shortcuts for changing script policy
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import UIKit_Private.UIKeyCommand_Private
|
||||
|
||||
@objc
|
||||
protocol ShortcutResponder: AnyObject {
|
||||
@@ -56,6 +57,12 @@ protocol ShortcutResponder: AnyObject {
|
||||
|
||||
@objc
|
||||
optional func handleOpenURL(_ sender: Any?, forEvent event: OpenURLEvent?)
|
||||
|
||||
@objc
|
||||
optional func lowerScriptPolicyRestriction(_ sender: Any?)
|
||||
|
||||
@objc
|
||||
optional func raiseScriptPolicyRestriction(_ sender: Any?)
|
||||
}
|
||||
|
||||
public class OpenURLEvent: UIEvent {
|
||||
@@ -153,6 +160,22 @@ public class KeyboardShortcuts {
|
||||
action: #selector(ShortcutResponder.stop)
|
||||
)
|
||||
]),
|
||||
|
||||
UIMenu(options: .displayInline, children: [
|
||||
// Raise Script Policy Restriction
|
||||
UIKeyCommand(
|
||||
modifiers: [.alternate], input: "x",
|
||||
title: "Raise Script Policy Restriction",
|
||||
action: #selector(ShortcutResponder.raiseScriptPolicyRestriction)
|
||||
)._nonRepeatable(),
|
||||
|
||||
// Lower Script Policy Restriction
|
||||
UIKeyCommand(
|
||||
modifiers: [.alternate], input: "c",
|
||||
title: "Lower Script Policy Restriction",
|
||||
action: #selector(ShortcutResponder.lowerScriptPolicyRestriction)
|
||||
)._nonRepeatable(),
|
||||
])
|
||||
].removeNulls()
|
||||
|
||||
case .go:
|
||||
|
||||
Reference in New Issue
Block a user