[iOS] Numpad comma key has incorrect keyIdentifier property
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 22:59:36 +0000 (22:59 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 May 2019 22:59:36 +0000 (22:59 +0000)
commit2283d370a4595fc388021766b43910b7b9379d10
tree7d30a439b23a5b0b48e3269c80f6276ba8fa7c1d
parent84c46909ebb48477af4384c1a8a83e5ff9d074e3
[iOS] Numpad comma key has incorrect keyIdentifier property
https://bugs.webkit.org/show_bug.cgi?id=197753
<rdar://problem/50636274>

Reviewed by Brent Fulgham.

Source/WebCore:

Map the Numpad Comma HID usage code to its Window virtual key code, VK_SEPARATOR,
so that can compute the keyIdentifier property for the Numpad Comma key. Also
consider this key as a keypad key just like we do on Mac. There is no discernable
difference for doing so on iOS because the non-keypad code path computes the same result
due to GraphicsServices having fixed up the input string for the Numpad Comma to be
",", which is want.

* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForKeyCode): Map kHIDUsage_KeypadComma to VK_SEPARATOR.
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::codeForKeyEvent): Add a comment to explain that this key is only on
JIS keyboards.
(WebCore::isKeypadEvent): Return true for the Numpad Comma key.

Source/WebCore/PAL:

Expose enumerator for Numpad Comma.

* pal/spi/cocoa/IOKitSPI.h:

Tools:

Recognize "numpadComma" and return the appropriate HID usage code.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(hidUsageCodeForCharacter):

LayoutTests:

Update test results.

* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt:
* fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt
LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h
Source/WebCore/platform/ios/KeyEventIOS.mm
Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm
Tools/ChangeLog
Tools/WebKitTestRunner/ios/HIDEventGenerator.mm