aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/script/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/shared/script/lib.rs')
-rw-r--r--components/shared/script/lib.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/components/shared/script/lib.rs b/components/shared/script/lib.rs
index ff6e2baeefb..895923930cd 100644
--- a/components/shared/script/lib.rs
+++ b/components/shared/script/lib.rs
@@ -1093,11 +1093,25 @@ pub struct GamepadInputBounds {
}
#[derive(Clone, Debug, Deserialize, Serialize)]
+/// The haptic effects supported by this gamepad
+pub struct GamepadSupportedHapticEffects {
+ /// Gamepad support for dual rumble effects
+ pub supports_dual_rumble: bool,
+ /// Gamepad support for trigger rumble effects
+ pub supports_trigger_rumble: bool,
+}
+
+#[derive(Clone, Debug, Deserialize, Serialize)]
/// The type of Gamepad event
pub enum GamepadEvent {
/// A new gamepad has been connected
/// <https://www.w3.org/TR/gamepad/#event-gamepadconnected>
- Connected(GamepadIndex, String, GamepadInputBounds),
+ Connected(
+ GamepadIndex,
+ String,
+ GamepadInputBounds,
+ GamepadSupportedHapticEffects,
+ ),
/// An existing gamepad has been disconnected
/// <https://www.w3.org/TR/gamepad/#event-gamepaddisconnected>
Disconnected(GamepadIndex),