Improve keyboard arrow keys navigation.

This commit is contained in:
Damiano Galassi committed 2019-11-11 19:36:00 +01:00
1 parent 7f0f87baca
commit 7ed44d94d4
13 files changed
+158 -112

No files matched your search

+16
View File
@@ -563,4 +563,20 @@ final class DocumentWindowController: NSWindowController, TracksViewControllerDe
return true
}
// MARK: Keyboard navigation
override func keyDown(with event: NSEvent) {
guard let key = event.charactersIgnoringModifiers?.utf16.first else { super.keyDown(with: event); return }
if key == NSRightArrowFunctionKey || key == NSLeftArrowFunctionKey {
let detailsItem = splitViewController.splitViewItems[1]
if let propertyView = detailsItem.viewController.children.first as? PropertyView {
propertyView.navigate(direction: Int(key))
}
} else {
super.keyDown(with: event)
}
}
}