Tagger: Saka-key like keyboard navigation link tagging

This commit is contained in:
James Magahern
2021-02-26 17:43:53 -08:00
parent 48a7c07551
commit 225761473d
4 changed files with 215 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ protocol VIMBindings
extension BrowserViewController: VIMBindings
{
static let keyboardScrollingEnabled = false // this is tricky...
static let keyboardScrollAmount: CGFloat = 33.0
override var keyCommands: [UIKeyCommand]? {
@@ -29,7 +30,7 @@ extension BrowserViewController: VIMBindings
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
if action == #selector(VIMBindings.scrollDownPressed) || action == #selector(VIMBindings.scrollUpPressed) {
return webView._contentViewIsFirstResponder && webView._currentContentView().isFocusingElement == false
return Self.keyboardScrollingEnabled && webView._contentViewIsFirstResponder && webView._currentContentView().isFocusingElement == false
}
return super.canPerformAction(action, withSender: sender)