[webkit-reviews] review granted: [Bug 212933] GameController.framework gamepads should support Home buttons : [Attachment 403971] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 10 11:57:38 PDT 2020


Tim Horton <thorton at apple.com> has granted Brady Eidson <beidson at apple.com>'s
request for review:
Bug 212933: GameController.framework gamepads should support Home buttons
https://bugs.webkit.org/show_bug.cgi?id=212933

Attachment 403971: Patch

https://bugs.webkit.org/attachment.cgi?id=403971&action=review




--- Comment #9 from Tim Horton <thorton at apple.com> ---
Comment on attachment 403971
  --> https://bugs.webkit.org/attachment.cgi?id=403971
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403971&action=review

> Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:57
> +static GCControllerButtonInput
*homeButtonFromExtendedGamepad(GCExtendedGamepad *gamepad)

I don't love the `valueForKey`s. Is there an SPI property you can use? Is the
string available anywhere?

> Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:78
> +    m_buttonValues.resize(homeButton ? 17 : 16);

These magic numbers are pretty weird!

> Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:114
> +	   bindButton(homeButton, 16);

Do the numbers match something in another project, or are they ours? If they're
ours, can we structure this in a less bizarre way?


More information about the webkit-reviews mailing list