[iOS] Hardware Keyboard: All combinations of arrow keys and space key do not scroll...
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2015 17:43:46 +0000 (17:43 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jun 2015 17:43:46 +0000 (17:43 +0000)
commit57482fe1cf5413a5c947a99335b4469b8f02f8bf
tree08b68add8c318359956d3a14a6297722160f287b
parent5bbe4ce84bdb66accb817c01a1b544e0f2d7eb4f
[iOS] Hardware Keyboard: All combinations of arrow keys and space key do not scroll the view.
https://bugs.webkit.org/show_bug.cgi?id=146290
rdar://problem/18466015

We don't normally get called by the keyboard to handle the event if we are not
interacting with editable content. In order to receive all the hardware keyboard events
we need to implement _handleKeyUIEvent which is called for every key event
when the view is first responder. This gives us the opportunity to send each keystroke
to the WebProcess to let any Javascript handler intercept it and then perform the default
action for the key combination.
Unfortunately this mechanism does not provide key repeat, which is implemented in the
keyboard layer. In order to have it at least for the arrow keys, we use the keyCommands
mechanism only for those.

Reviewed by Darin Adler.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollByOffset:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]):
(-[WKContentView keyCommands]):
(-[WKContentView _arrowKey:]):
(-[WKContentView _handleKeyUIEvent:]):
(-[WKContentView handleKeyEvent:]):
(-[WKContentView handleKeyWebEvent:]):
(-[WKContentView _interpretKeyEvent:isCharEvent:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/ios/UIKitSPI.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm