diff --git a/Cartfile.resolved b/Cartfile.resolved index e69469b..c85d06b 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Clipy/Magnet" "v3.2.0" -github "Clipy/Sauce" "v2.1.0" +github "Clipy/Magnet" "v3.3.0" +github "Clipy/Sauce" "v2.2.0" diff --git a/Carthage/Checkouts/Magnet b/Carthage/Checkouts/Magnet index fbf67ce..e719b5c 160000 --- a/Carthage/Checkouts/Magnet +++ b/Carthage/Checkouts/Magnet @@ -1 +1 @@ -Subproject commit fbf67cebb2ab6b99786f2b046fbad8fba8524889 +Subproject commit e719b5cae545a43e2965a3fbbdd42485c3a3abcb 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/KeyHolder.podspec b/KeyHolder.podspec index 80c438c..f9a5d01 100644 --- a/KeyHolder.podspec +++ b/KeyHolder.podspec @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.source_files = 'Lib/KeyHolder/**/*.swift' s.swift_version = '5.0' s.frameworks = 'Carbon', 'Cocoa' - s.dependency 'Magnet', '~> 3.2' + s.dependency 'Magnet', '~> 3.3.0' end diff --git a/Lib/KeyHolder/RecordView.swift b/Lib/KeyHolder/RecordView.swift index a98d4fc..86cee04 100644 --- a/Lib/KeyHolder/RecordView.swift +++ b/Lib/KeyHolder/RecordView.swift @@ -143,7 +143,7 @@ open class RecordView: NSView { private func drawModifiers(_ dirtyRect: NSRect) { let fontSize = self.fontSize - let modifiers = keyCombo?.modifiers.convertSupportCocoaModifiers() ?? inputModifiers + let modifiers = keyCombo.map { NSEvent.ModifierFlags(carbonModifiers: $0.modifiers) } ?? inputModifiers for (i, text) in validModifiersText.enumerated() { let rect = NSRect(x: marginX + (fontSize * CGFloat(i)), y: marginY, width: fontSize, height: bounds.height) text.draw(in: rect, withAttributes: modifierTextAttributes(modifiers, checkModifier: validModifiers[i])) @@ -208,7 +208,7 @@ open class RecordView: NSView { override open func performKeyEquivalent(with theEvent: NSEvent) -> Bool { guard isFirstResponder else { return false } - guard let key = Sauce.shared.key(by: Int(theEvent.keyCode)) else { return false } + guard let key = Sauce.shared.key(for: Int(theEvent.keyCode)) else { return false } if theEvent.modifierFlags.carbonModifiers() != 0 { let modifiers = theEvent.modifierFlags.carbonModifiers() diff --git a/Package.swift b/Package.swift index 6db5212..c33b15e 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( targets: ["KeyHolder"]), ], dependencies: [ - .package(url: "https://github.com/Clipy/Magnet", from: "3.2.0"), + .package(url: "https://github.com/Clipy/Magnet", .upToNextMinor(from: "3.3.0")), ], targets: [ .target(