mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-05 12:56:42 +02:00
17 lines
542 B
JavaScript
Executable File
17 lines
542 B
JavaScript
Executable File
const gamepad = e.gamepad;
|
|
if (gamepad?.connected) {
|
|
const gamepadSettings = window.BX_STREAM_SETTINGS.controllers[gamepad.id];
|
|
if (gamepadSettings) {
|
|
const intensity = gamepadSettings.vibrationIntensity;
|
|
|
|
if (intensity === 0) {
|
|
return void(e.repeat = 0);
|
|
} else if (intensity < 1) {
|
|
e.leftMotorPercent *= intensity;
|
|
e.rightMotorPercent *= intensity;
|
|
e.leftTriggerMotorPercent *= intensity;
|
|
e.rightTriggerMotorPercent *= intensity;
|
|
}
|
|
}
|
|
}
|