From 687a6ee21f8994935e3f53b352813094e3e15ad6 Mon Sep 17 00:00:00 2001 From: Gabriel Brito Date: Wed, 7 Feb 2024 17:10:56 -0800 Subject: [PATCH 1/5] Add trigger-rumble effect --- index.html | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 9587de4..5ee1342 100644 --- a/index.html +++ b/index.html @@ -1418,7 +1418,8 @@

         enum GamepadHapticEffectType {
-          "dual-rumble"
+          "dual-rumble",
+          "trigger-rumble"
         };
       
@@ -1455,12 +1456,54 @@

Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, a valid dual-rumble effect must have a valid - duration, a valid startDelay, and both the + {{GamepadEffectParameters/duration}}, a valid {{GamepadEffectParameters/startDelay}}, and both the {{GamepadEffectParameters/strongMagnitude}} and the {{GamepadEffectParameters/weakMagnitude}} must be in the range `[0,1]`.

+
+ "trigger-rumble" effect + type +
+
+

+ {{GamepadHapticEffectType/"trigger-rumble"}} describes a haptics + configuration with a vibration motor in each of the bottom front buttons + of a [=Standard Gamepad=] (buttons with [=canonical indexes=] 6 and 7) in addition to the two handle motors used for + {{GamepadHapticEffectType/"dual-rumble"}}. Nowadays these buttons + most-commonly take the form of spring-loaded triggers. In this + configuration, either motor is capable of providing localized haptic + feedback on the button's surface. +

+

+ A {{GamepadHapticEffectType/"trigger-rumble"}} effect is a + fixed-duration, constant-intensity vibration effect intended for an + actuator of this type. {{GamepadHapticEffectType/"trigger-rumble"}} + effects are defined by {{GamepadEffectParameters/startDelay}}, + {{GamepadEffectParameters/duration}}, + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}}, {{GamepadEffectParameters/leftTrigger}}, and {{GamepadEffectParameters/rightTrigger}}, none of which are + required because they default to 0. +

+

+ {{GamepadEffectParameters/startDelay}}, {{GamepadEffectParameters/duration}}, + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}} share the same definition with {{GamepadHapticEffectType/"dual-rumble"}}. + {{GamepadEffectParameters/leftTrigger}} and + {{GamepadEffectParameters/rightTrigger}}, respectively, set the + intensity levels for the left and right bottom front buttons + vibrations, normalized to the range `[0,1]`, defaulting to 0. +

+

+ Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, + a valid trigger-rumble effect must have a valid + {{GamepadEffectParameters/duration}}, a valid {{GamepadEffectParameters/startDelay}}, and the + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}}, {{GamepadEffectParameters/leftTrigger}}, and {{GamepadEffectParameters/rightTrigger}} must be in the range + `[0,1]`. +

+

@@ -1484,6 +1527,8 @@

unsigned long long startDelay = 0; double strongMagnitude = 0.0; double weakMagnitude = 0.0; + double leftTrigger = 0.0; + double rightTrigger = 0.0; };
@@ -1508,14 +1553,26 @@

The vibration magnitude for the low frequency rumble in a - {{GamepadHapticEffectType/"dual-rumble"}} effect. + {{GamepadHapticEffectType/"dual-rumble"}} or {{GamepadHapticEffectType/"trigger-rumble"}} effect.
weakMagnitude member
The vibration magnitude for the high frequency rumble in a - {{GamepadHapticEffectType/"dual-rumble"}} effect. + {{GamepadHapticEffectType/"dual-rumble"}} or {{GamepadHapticEffectType/"trigger-rumble"}} effect. +
+
+ leftTrigger member +
+
+ The vibration magnitude for the bottom left front button rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect. +
+
+ rightTrigger member +
+
+ The vibration magnitude for the bottom right front button rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect.

@@ -1753,7 +1810,7 @@

If an axis or button input represents a [=Standard Gamepad=] axis or - button, then its canonical index is the index of the + button, then its canonical index is the index of the corresponding [=Standard Gamepad=] axis or button.

From b0c49ee6bbab0721488514e8e06b344bd4810a0d Mon Sep 17 00:00:00 2001 From: Gabriel Brito Date: Wed, 28 Feb 2024 18:20:36 -0800 Subject: [PATCH 2/5] Add canonical button indexes --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 5ee1342..cedcab7 100644 --- a/index.html +++ b/index.html @@ -1566,13 +1566,13 @@

leftTrigger member
- The vibration magnitude for the bottom left front button rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect. + The vibration magnitude for the bottom left front button ([=canonical index=] 6) rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect.
rightTrigger member
- The vibration magnitude for the bottom right front button rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect. + The vibration magnitude for the bottom right front button ([=canonical index=] 7) rumble in a {{GamepadHapticEffectType/"trigger-rumble"}} effect.
From 5edd133dda5754295f5258210908b3a0862c0727 Mon Sep 17 00:00:00 2001 From: Gabriel Brito Date: Fri, 15 Mar 2024 11:01:23 -0700 Subject: [PATCH 3/5] Address code review feedback --- index.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index cedcab7..0e1d89d 100644 --- a/index.html +++ b/index.html @@ -1292,6 +1292,13 @@

If |params| does not describe a [=valid dual-rumble effect=], return `false`. +
+ {{GamepadHapticEffectType/"trigger-rumble"}} +
+
+ If |params| does not describe a [=valid trigger-rumble effect=], + return `false`. +
  • Return `true` @@ -1470,9 +1477,9 @@

    {{GamepadHapticEffectType/"trigger-rumble"}} describes a haptics configuration with a vibration motor in each of the bottom front buttons - of a [=Standard Gamepad=] (buttons with [=canonical indexes=] 6 and 7) in addition to the two handle motors used for + of a [=Standard Gamepad=] (buttons with [=canonical indices=] 6 and 7) in addition to the two handle motors used for {{GamepadHapticEffectType/"dual-rumble"}}. Nowadays these buttons - most-commonly take the form of spring-loaded triggers. In this + most commonly take the form of spring-loaded triggers. In this configuration, either motor is capable of providing localized haptic feedback on the button's surface.

    @@ -1810,7 +1817,7 @@

    If an axis or button input represents a [=Standard Gamepad=] axis or - button, then its canonical index is the index of the + button, then its canonical index is the index of the corresponding [=Standard Gamepad=] axis or button.

  • From 0594657618035219dab2e19273b95e704124ef2c Mon Sep 17 00:00:00 2001 From: Gabriel Brito <80070607+gabrielsanbrito@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:26:51 -0700 Subject: [PATCH 4/5] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove "nowadays" Co-authored-by: Marcos Cáceres --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 0e1d89d..4184f8c 100644 --- a/index.html +++ b/index.html @@ -1478,7 +1478,7 @@

    {{GamepadHapticEffectType/"trigger-rumble"}} describes a haptics configuration with a vibration motor in each of the bottom front buttons of a [=Standard Gamepad=] (buttons with [=canonical indices=] 6 and 7) in addition to the two handle motors used for - {{GamepadHapticEffectType/"dual-rumble"}}. Nowadays these buttons + {{GamepadHapticEffectType/"dual-rumble"}}. These buttons most commonly take the form of spring-loaded triggers. In this configuration, either motor is capable of providing localized haptic feedback on the button's surface. From ee121796958022083d9630d770d211e2a3d31311 Mon Sep 17 00:00:00 2001 From: Gabriel Brito Date: Fri, 29 Mar 2024 16:04:20 -0700 Subject: [PATCH 5/5] Add links to 'valid effect' --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 4184f8c..888710d 100644 --- a/index.html +++ b/index.html @@ -1462,8 +1462,8 @@

    Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, - a valid dual-rumble effect must have a valid - {{GamepadEffectParameters/duration}}, a valid {{GamepadEffectParameters/startDelay}}, and both the + a valid dual-rumble effect must have a [=valid effect|valid=] + {{GamepadEffectParameters/duration}}, a [=valid effect|valid=] {{GamepadEffectParameters/startDelay}}, and both the {{GamepadEffectParameters/strongMagnitude}} and the {{GamepadEffectParameters/weakMagnitude}} must be in the range `[0,1]`. @@ -1504,8 +1504,8 @@

    Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, - a valid trigger-rumble effect must have a valid - {{GamepadEffectParameters/duration}}, a valid {{GamepadEffectParameters/startDelay}}, and the + a valid trigger-rumble effect must have a [=valid effect|valid=] + {{GamepadEffectParameters/duration}}, a [=valid effect|valid=] {{GamepadEffectParameters/startDelay}}, and the {{GamepadEffectParameters/strongMagnitude}}, {{GamepadEffectParameters/weakMagnitude}}, {{GamepadEffectParameters/leftTrigger}}, and {{GamepadEffectParameters/rightTrigger}} must be in the range `[0,1]`.