Skip to content

Commit

Permalink
Update Sauce.framework v2.2.0 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Econa77 committed Apr 11, 2021
1 parent d35eb4c commit 4193969
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Clipy/Sauce" "v2.1.0"
github "Clipy/Sauce" "v2.2.0"
2 changes: 1 addition & 1 deletion Lib/Magnet/Extensions/NSEventExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
10 changes: 5 additions & 5 deletions Lib/Magnet/KeyCombo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Magnet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 4193969

Please sign in to comment.