mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Listen for shift-key on launch to run debug code
This commit is contained in:
parent
b987ab703f
commit
bcf496e15d
@ -1,6 +1,21 @@
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct CheckForDebugModifier {
|
||||
static func main() {
|
||||
#if os(macOS)
|
||||
if NSEvent.modifierFlags.contains(.shift) {
|
||||
print("Debug launch detected")
|
||||
// Run debug-mode launch code here
|
||||
} else {
|
||||
print("Normal launch detected")
|
||||
// Don't do anything
|
||||
}
|
||||
#endif
|
||||
WriteFreely_MultiPlatformApp.main()
|
||||
}
|
||||
}
|
||||
|
||||
struct WriteFreely_MultiPlatformApp: App {
|
||||
@StateObject private var model = WriteFreelyModel()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user