This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| enum OSDocumentError: Error { | |
| case unknownFileFormat | |
| } | |
| #if canImport(UIKit) | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| extension CGKeyCode | |
| { | |
| // Define whatever key codes you want to detect here | |
| static let kVK_Space: CGKeyCode = 0x31 | |
| var isPressed: Bool { | |
| CGEventSource.keyState(.combinedSessionState, key: self) | |
| } |