Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Clipy/Magnet" "v3.4.0"
github "Clipy/Sauce" "v2.4.0"
github "Clipy/Magnet" "v3.5.0"
github "Clipy/Sauce" "v2.5.0"
2 changes: 2 additions & 0 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -360,6 +361,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
4 changes: 4 additions & 0 deletions Lib/KeyHolder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
INFOPLIST_FILE = KeyHolder/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.KeyHolder";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -446,6 +447,7 @@
INFOPLIST_FILE = KeyHolder/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.KeyHolder";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -459,6 +461,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = KeyHolderTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.KeyHolderTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
Expand All @@ -472,6 +475,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = KeyHolderTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 11.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.clipy-app.KeyHolderTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
Expand Down
10 changes: 5 additions & 5 deletions Lib/KeyHolder/RecordView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ open class RecordView: NSView {

override open func performKeyEquivalent(with theEvent: NSEvent) -> Bool {
guard isFirstResponder else { return false }
guard let key = Sauce.shared.key(for: Int(theEvent.keyCode)) else { return false }
let modifiers = theEvent.modifierFlags.carbonModifiers()
guard let key = Sauce.shared.key(for: Int(theEvent.keyCode), carbonModifiers: modifiers) else { return false }

if theEvent.modifierFlags.carbonModifiers() != 0 {
let modifiers = theEvent.modifierFlags.carbonModifiers()
guard let keyCombo = KeyCombo(key: key, carbonModifiers: modifiers) else { return false }
if modifiers != 0 {
let keyCombo = KeyCombo(key: key, carbonModifiers: modifiers)
guard delegate?.recordView(self, canRecordKeyCombo: keyCombo) ?? true else { return false }
self.keyCombo = keyCombo
didChange?(keyCombo)
delegate?.recordView(self, didChangeKeyCombo: keyCombo)
endRecording()
return true
} else if key.isFunctionKey {
guard let keyCombo = KeyCombo(key: key, cocoaModifiers: []) else { return false }
let keyCombo = KeyCombo(key: key, cocoaModifiers: [])
guard delegate?.recordView(self, canRecordKeyCombo: keyCombo) ?? true else { return false }
self.keyCombo = keyCombo
didChange?(keyCombo)
Expand Down
19 changes: 1 addition & 18 deletions Lib/KeyHolderTests/KeyHolderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,4 @@
import XCTest
@testable import KeyHolder

class KeyHolderTests: XCTestCase {

override func setUp() {
super.setUp()
}

override func tearDown() {
super.tearDown()
}

func testExample() {}

func testPerformanceExample() {
self.measure {
}
}

}
class KeyHolderTests: XCTestCase {}
15 changes: 9 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.9
import PackageDescription

let package = Package(
name: "KeyHolder",
platforms: [
.macOS(.v10_13)
.macOS(.v11)
],
products: [
.library(
name: "KeyHolder",
targets: ["KeyHolder"]),
],
dependencies: [
.package(url: "https://github.com/Clipy/Magnet", .upToNextMinor(from: "3.4.0")),
.package(url: "https://github.com/Clipy/Magnet", .upToNextMinor(from: "3.5.0")),
],
targets: [
.target(
name: "KeyHolder",
dependencies: ["Magnet"],
path: "Lib/KeyHolder"),
path: "Lib/KeyHolder",
exclude: ["Info.plist"]
),
.testTarget(
name: "KeyHolderTests",
dependencies: ["KeyHolder"],
path: "Lib/KeyHolderTests"),
path: "Lib/KeyHolderTests",
exclude: ["Info.plist"]
),
],
swiftLanguageVersions: [.v5]
)