Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamepad.vibrationActuator: Add support for "trigger-rumble" effect type #9075

Commits on Jan 27, 2023

  1. Gamepad.vibrationActuator: Add support for "trigger-rumble" effect type

    https://bugs.webkit.org/show_bug.cgi?id=250352
    rdar://104315486
    
    Reviewed by Brent Fulgham and Geoffrey Garen.
    
    Gamepad.vibrationActuator: Add support for "trigger-rumble" effect type:
    -  https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/GamepadHapticsActuatorTriggerRumble/explainer.md
    
    It allows vibrating the triggers (which the XBox controller supports), while the
    existing "dual-rumble" only makes the handles vibrate.
    
    This isn't yet part of the specification at:
    - https://w3c.github.io/gamepad/extensions.html#dom-gamepadhapticeffecttype
    
    However, it is supported by Blink and used by XBox cloud games.
    
    I am adding support behind an experimental feature flag, off by default.
    
    * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
    * Source/WebCore/Modules/gamepad/GamepadEffectParameters.h:
    * Source/WebCore/Modules/gamepad/GamepadEffectParameters.idl:
    * Source/WebCore/Modules/gamepad/GamepadHapticActuator.cpp:
    (WebCore::GamepadHapticActuator::canPlayEffectType const):
    (WebCore::GamepadHapticActuator::playEffect):
    (WebCore::GamepadHapticActuator::stopEffects):
    (WebCore::GamepadHapticActuator::document const):
    (WebCore::GamepadHapticActuator::promiseForEffectType):
    * Source/WebCore/Modules/gamepad/GamepadHapticActuator.h:
    * Source/WebCore/Modules/gamepad/GamepadHapticEffectType.idl:
    * Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:
    (WebCore::GameControllerGamepad::setupElements):
    * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEffect.h:
    * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEffect.mm:
    (WebCore::GameControllerHapticEffect::create):
    (WebCore::GameControllerHapticEffect::GameControllerHapticEffect):
    (WebCore::GameControllerHapticEffect::start):
    (WebCore::GameControllerHapticEffect::stop):
    (WebCore::GameControllerHapticEffect::leftEffectFinishedPlaying):
    (WebCore::GameControllerHapticEffect::rightEffectFinishedPlaying):
    (WebCore::GameControllerHapticEffect::strongEffectFinishedPlaying): Deleted.
    (WebCore::GameControllerHapticEffect::weakEffectFinishedPlaying): Deleted.
    * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEngines.h:
    (WebCore::GameControllerHapticEngines::leftHandleEngine):
    (WebCore::GameControllerHapticEngines::rightHandleEngine):
    (WebCore::GameControllerHapticEngines::leftTriggerEngine):
    (WebCore::GameControllerHapticEngines::rightTriggerEngine):
    (WebCore::GameControllerHapticEngines::strongEngine): Deleted.
    (WebCore::GameControllerHapticEngines::weakEngine): Deleted.
    * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEngines.mm:
    (WebCore::GameControllerHapticEngines::GameControllerHapticEngines):
    (WebCore::GameControllerHapticEngines::currentEffectForType):
    (WebCore::GameControllerHapticEngines::playEffect):
    (WebCore::GameControllerHapticEngines::stopEffects):
    (WebCore::GameControllerHapticEngines::ensureStarted):
    (WebCore::GameControllerHapticEngines::stop):
    * Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.h:
    * Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.mm:
    * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
    
    Canonical link: https://commits.webkit.org/259507@main
    cdumez committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    2dca512 View commit details
    Browse the repository at this point in the history