diff options
Diffstat (limited to 'iGopherBrowser/BrowserView.swift')
-rw-r--r-- | iGopherBrowser/BrowserView.swift | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/iGopherBrowser/BrowserView.swift b/iGopherBrowser/BrowserView.swift index 17bc89e..50e722c 100644 --- a/iGopherBrowser/BrowserView.swift +++ b/iGopherBrowser/BrowserView.swift @@ -423,6 +423,21 @@ struct BrowserView: View { #endif } .accentColor(accentColour) + + .onAppear { + #if os(OSX) + NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in + if event.modifierFlags.contains([.option, .command]) && event.charactersIgnoringModifiers == "f" { + isURLFocused = true + return nil + } else if event.keyCode == 53 { + isURLFocused = false + return nil + } + return event + } + #endif + } } private func goBack() { |