Add HID-based gamepad implementation for Mac This also hooks up the platform abstractions to the actual Gamepad mechanisms. This gets the gamepad API working in WK1, and the pieces for WK2 support are also there for later use.
Created attachment 233867 [details] Patch v1 I don't expect this to pass EWS yet because it relies on the patch in bug 134325 landing first. But it's ready for review.
Comment on attachment 233867 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=233867&action=review > Source/WebCore/Modules/gamepad/Gamepad.cpp:45 > + for (unsigned i = 0; i < platformGamepad.buttonValues().size(); ++i) > + m_buttons.append(GamepadButton::create()); Can this be a C++11 for loop? > Source/WebCore/Modules/gamepad/GamepadManager.cpp:71 > + // connectect/disconnected event listeners. Nit: typo connected > Source/WebCore/Modules/gamepad/GamepadManager.cpp:83 > + // connectect/disconnected event listeners. Ditto
(In reply to comment #2) > (From update of attachment 233867 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=233867&action=review > > > Source/WebCore/Modules/gamepad/Gamepad.cpp:45 > > + for (unsigned i = 0; i < platformGamepad.buttonValues().size(); ++i) > > + m_buttons.append(GamepadButton::create()); > > Can this be a C++11 for loop? Yes. > > > Source/WebCore/Modules/gamepad/GamepadManager.cpp:71 > > + // connectect/disconnected event listeners. > > Nit: typo connected > > > Source/WebCore/Modules/gamepad/GamepadManager.cpp:83 > > + // connectect/disconnected event listeners. > > Ditto Got it. Thanks!
Created attachment 233875 [details] Patch for landing v1
Attachment 233875 [details] did not pass style-queue: ERROR: Source/WebCore/Modules/gamepad/Gamepad.h:60: The parameter name "platformGamepad" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebCore/platform/mac/HIDGamepad.cpp:64: Use 0 instead of NULL. [readability/null] [5] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 233878 [details] Patch for landing v2 - Fix *one* style complaint, remove stale #include that will fix the build
Attachment 233878 [details] did not pass style-queue: ERROR: Source/WebCore/platform/mac/HIDGamepad.cpp:64: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 233878 [details] Patch for landing v2 - Fix *one* style complaint, remove stale #include that will fix the build Clearing flags on attachment: 233878 Committed r170465: <http://trac.webkit.org/changeset/170465>
All reviewed patches have been landed. Closing bug.
Build fix attempt landed in http://trac.webkit.org/changeset/170468.