Skip to content

Commit

Permalink
Make isReservedBySystem(key:modifiers:) public
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Aug 16, 2023
1 parent 33692c3 commit 52fffc9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Sources/SwiftKeys/KeyCommand/KeyCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,19 @@ public struct KeyCommand {

// MARK: Static Methods

static func isReservedBySystem(key: Key, modifiers: [Modifier]) -> Bool {
/// Returns a Boolean value that indicates whether the given key-modifier
/// combination is reserved for system use.
///
/// This can be useful when you need to determine if a key-modifier combination
/// is available for use as a key command before actually creating the command.
///
/// - Parameters:
/// - key: The key to look for in the system.
/// - modifiers: The modifiers to look for in the system.
///
/// - Returns: `true` if the system reserves the given key-modifier combination
/// for its own use. `false` otherwise.
public static func isReservedBySystem(key: Key, modifiers: [Modifier]) -> Bool {
reservedHotKeys.contains { hotKey in
guard
hotKey[kHISymbolicHotKeyEnabled] as? Bool == true,
Expand Down

0 comments on commit 52fffc9

Please sign in to comment.