diff --git a/Cartfile.resolved b/Cartfile.resolved index 0b23358..cd84b29 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "Clipy/Sauce" "v2.1.0" +github "Clipy/Sauce" "v2.2.0" diff --git a/Carthage/Checkouts/Sauce b/Carthage/Checkouts/Sauce index 6050822..2fcf7e4 160000 --- a/Carthage/Checkouts/Sauce +++ b/Carthage/Checkouts/Sauce @@ -1 +1 @@ -Subproject commit 60508229cecbb915866151ebe9a0bf060a454c84 +Subproject commit 2fcf7e43a242b183fdea3f2275ebec0d773b65f5 diff --git a/Lib/Magnet/Extensions/NSEventExtension.swift b/Lib/Magnet/Extensions/NSEventExtension.swift index c84072c..76da882 100644 --- a/Lib/Magnet/Extensions/NSEventExtension.swift +++ b/Lib/Magnet/Extensions/NSEventExtension.swift @@ -114,7 +114,7 @@ extension NSEvent { /// Returns a matching `KeyCombo` for the event, if the event is a keyboard event and the key is recognized. public var keyCombo: KeyCombo? { guard self.type.isKeyboardEvent else { return nil } - guard let key = Sauce.shared.key(by: Int(self.keyCode)) else { return nil } + guard let key = Sauce.shared.key(for: Int(self.keyCode)) else { return nil } return KeyCombo(key: key, cocoaModifiers: self.modifierFlags) } } diff --git a/Lib/Magnet/KeyCombo.swift b/Lib/Magnet/KeyCombo.swift index b5b4a90..6e08fad 100644 --- a/Lib/Magnet/KeyCombo.swift +++ b/Lib/Magnet/KeyCombo.swift @@ -24,14 +24,14 @@ public final class KeyCombo: NSObject, NSCopying, NSCoding, Codable { } public var characters: String { guard !doubledModifiers else { return "" } - return Sauce.shared.character(by: Int(Sauce.shared.keyCode(by: key)), carbonModifiers: modifiers) ?? "" + return Sauce.shared.character(for: Int(Sauce.shared.keyCode(for: key)), carbonModifiers: modifiers) ?? "" } public var keyEquivalent: String { guard !doubledModifiers else { return "" } - let keyCode = Int(Sauce.shared.keyCode(by: key)) - guard key.isAlphabet else { return Sauce.shared.character(by: keyCode, cocoaModifiers: []) ?? "" } + let keyCode = Int(Sauce.shared.keyCode(for: key)) + guard key.isAlphabet else { return Sauce.shared.character(for: keyCode, cocoaModifiers: []) ?? "" } let modifiers = keyEquivalentModifierMask.filterNotShiftModifiers() - return Sauce.shared.character(by: keyCode, cocoaModifiers: modifiers) ?? "" + return Sauce.shared.character(for: keyCode, cocoaModifiers: modifiers) ?? "" } public var keyEquivalentModifierMask: NSEvent.ModifierFlags { return NSEvent.ModifierFlags(carbonModifiers: self.modifiers) @@ -41,7 +41,7 @@ public final class KeyCombo: NSObject, NSCopying, NSCoding, Codable { } public var currentKeyCode: CGKeyCode { guard !doubledModifiers else { return 0 } - return Sauce.shared.keyCode(by: key) + return Sauce.shared.keyCode(for: key) } // MARK: - Initialize diff --git a/Magnet.podspec b/Magnet.podspec index 8210346..6f6b4f5 100644 --- a/Magnet.podspec +++ b/Magnet.podspec @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.source_files = 'Lib/Magnet/**/*.swift' s.swift_version = '5.0' s.frameworks = 'Carbon', 'Cocoa' - s.dependency 'Sauce', '~> 2.1' + s.dependency 'Sauce', '~> 2.2' end diff --git a/Package.swift b/Package.swift index 5a3b54b..e014f10 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( targets: ["Magnet"]), ], dependencies: [ - .package(url: "https://github.com/Clipy/Sauce", from: "2.1.0"), + .package(url: "https://github.com/Clipy/Sauce", from: "2.2.0"), ], targets: [ .target(