Added joystick vibration support for most common controllers (resolves issue #159).

Added Joystick:setVibration(left, right), Joystick:getVibration, and Joystick:isVibrationSupported.
left and right are numbers between 0 and 1 which correspond to the strength of the gamepad's left and right rumble motors, if it has them.
This commit is contained in:
Alex Szpakowski
2013-10-05 01:54:41 -03:00
parent 0e6786988e
commit 8b7f151a4d
9 changed files with 279 additions and 5 deletions
+7 -1
View File
@@ -1502,11 +1502,17 @@ function love.errhand(msg)
end
end
-- Load.
-- Reset state.
if love.mouse then
love.mouse.setVisible(true)
love.mouse.setGrabbed(false)
end
if love.joystick then
-- Stop all joystick vibrations.
for i,v in ipairs(love.joystick.getJoysticks()) do
v:setVibration()
end
end
if love.audio then love.audio.stop() end
love.graphics.reset()
love.graphics.setBackgroundColor(89, 157, 220)