internal/gamepad: bug fix: Y axis values are opposite on Xbox

Updates #2084
This commit is contained in:
Hajime Hoshi 2022-07-15 14:55:28 +09:00
parent b31ce0a568
commit c14403f195

View File

@ -162,11 +162,11 @@ func (n *nativeGamepadXbox) axisValue(axis int) float64 {
case gamepaddb.StandardAxisLeftStickHorizontal: case gamepaddb.StandardAxisLeftStickHorizontal:
return float64(n.state.leftThumbstickX) return float64(n.state.leftThumbstickX)
case gamepaddb.StandardAxisLeftStickVertical: case gamepaddb.StandardAxisLeftStickVertical:
return float64(n.state.leftThumbstickY) return -float64(n.state.leftThumbstickY)
case gamepaddb.StandardAxisRightStickHorizontal: case gamepaddb.StandardAxisRightStickHorizontal:
return float64(n.state.rightThumbstickX) return float64(n.state.rightThumbstickX)
case gamepaddb.StandardAxisRightStickVertical: case gamepaddb.StandardAxisRightStickVertical:
return float64(n.state.rightThumbstickY) return -float64(n.state.rightThumbstickY)
} }
return 0 return 0
} }