Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5dbec340da22d814d66692dacb641c2a3eefb936
      
https://github.com/WebKit/WebKit/commit/5dbec340da22d814d66692dacb641c2a3eefb936
  Author: Diego Pino Garcia <[email protected]>
  Date:   2025-09-05 (Fri, 05 Sep 2025)

  Changed paths:
    M Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp
    M Source/WebCore/platform/gamepad/manette/ManetteGamepad.h
    M Source/WebKit/WPEPlatform/wpe/WPEGamepadManette.cpp

  Log Message:
  -----------
  [GTK][WPE] Gamepad press buttons or axis events not triggered
https://bugs.webkit.org/show_bug.cgi?id=298310

Reviewed by Carlos Garcia Campos.

When WebKitGTK or WPEWebKit try to map a button or axis number to the
canonical layout defined in the W3C Gamepad spec, they return 'Unknown' in
case the button or axis number doesn't correspond to a standard value.
As a result of that, press button or axis events are not handled if
value was 'Unknown', what gives the impression the event didn't even happen.

The W3C Gamepad spec recommends to remap buttons and axis to a canonical
ordering if possible. In case not, the devices should still be exposed in
their raw form.

So, instead of returning 'Unknown' for a value outside of range,
we return the modulo of the raw value by the total number of standard
values.  That ensures the value will always be within the range and the
events will always be handled if they were triggered.

* Source/WebCore/platform/gamepad/manette/ManetteGamepad.cpp:
(WebCore::toStandardGamepadAxis):
(WebCore::toStandardGamepadButton):
(WebCore::ManetteGamepad::ManetteGamepad):
(WebCore::ManetteGamepad::buttonPressedOrReleased):
(WebCore::ManetteGamepad::absoluteAxisChanged):
* Source/WebCore/platform/gamepad/manette/ManetteGamepad.h:
* Source/WebKit/WPEPlatform/wpe/WPEGamepadManette.cpp:
(wpeGamepadButton):
(wpeGamepadAxis):
(wpeGamepadManetteStartInputMonitor):
(wpeGamepadButtonFromEvent): Deleted.

Canonical link: https://commits.webkit.org/299618@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to