internal/gamepad: improve resetting vibrations

This commit is contained in:
Hajime Hoshi 2022-07-16 02:44:54 +09:00
parent 90ac7d047d
commit 356c625601

View File

@ -229,6 +229,7 @@ func (n *nativeGamepadXbox) hatState(hat int) int {
func (n *nativeGamepadXbox) vibrate(duration time.Duration, strongMagnitude float64, weakMagnitude float64) { func (n *nativeGamepadXbox) vibrate(duration time.Duration, strongMagnitude float64, weakMagnitude float64) {
if strongMagnitude <= 0 && weakMagnitude <= 0 { if strongMagnitude <= 0 && weakMagnitude <= 0 {
n.vib = false
n.gameInputDevice.SetRumbleState(&_GameInputRumbleParams{ n.gameInputDevice.SetRumbleState(&_GameInputRumbleParams{
lowFrequency: 0, lowFrequency: 0,
highFrequency: 0, highFrequency: 0,