Bug 214911

Summary: Special HID mapping for the Dualshock 3 controller
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: sam, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 214910    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Brady Eidson 2020-07-28 22:22:13 PDT
Special HID mapping for the Dualshock 3 controller

Of the controllers that work on macOS out of the box that are not supported by GameController framework, the DS3 is by far the most popular. It also happens to cleanly map to the Web Gamepad "standard" gamepad mapping.

This will be easy after https://bugs.webkit.org/show_bug.cgi?id=214910
Comment 1 Radar WebKit Bug Importer 2020-07-28 22:22:36 PDT
<rdar://problem/66255198>
Comment 2 Brady Eidson 2020-07-30 19:01:50 PDT
Created attachment 405651 [details]
Patch
Comment 3 Sam Weinig 2020-07-30 19:37:17 PDT
Comment on attachment 405651 [details]
Patch

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

> Source/WebCore/platform/gamepad/GamepadConstants.h:30
> +#import <IOKit/hid/IOHIDUsageTables.h>

This doesn't seem like this belongs in a platform file that is not OS(DARWIN) specific, or at least guarded by OS(DARWIN) in someway.
Comment 4 Brady Eidson 2020-07-30 19:59:26 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 405651 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405651&action=review
> 
> > Source/WebCore/platform/gamepad/GamepadConstants.h:30
> > +#import <IOKit/hid/IOHIDUsageTables.h>
> 
> This doesn't seem like this belongs in a platform file that is not
> OS(DARWIN) specific, or at least guarded by OS(DARWIN) in someway.

Yup quite right.
Comment 5 Brady Eidson 2020-07-30 19:59:58 PDT
(In reply to Brady Eidson from comment #4)
> (In reply to Sam Weinig from comment #3)
> > Comment on attachment 405651 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=405651&action=review
> > 
> > > Source/WebCore/platform/gamepad/GamepadConstants.h:30
> > > +#import <IOKit/hid/IOHIDUsageTables.h>
> > 
> > This doesn't seem like this belongs in a platform file that is not
> > OS(DARWIN) specific, or at least guarded by OS(DARWIN) in someway.
> 
> Yup quite right.

That said only the Darwin platforms are broken and all the linucies work lol
Comment 6 Brady Eidson 2020-07-30 22:27:45 PDT
Created attachment 405669 [details]
Patch
Comment 7 Tim Horton 2020-07-31 11:28:31 PDT
Comment on attachment 405669 [details]
Patch

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

> Source/WebCore/platform/gamepad/GamepadConstants.h:58
> +extern const size_t numberStandardGamepadButtonsWithoutHomeButton;

number... Of?
Comment 8 Brady Eidson 2020-07-31 11:45:09 PDT
Created attachment 405718 [details]
Patch
Comment 9 EWS 2020-07-31 12:50:38 PDT
Committed r265156: <https://trac.webkit.org/changeset/265156>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405718 [details].