Enables or disables key repeat for love.keypressed. It is disabled by default.
Available since LÖVE 0.9.0
This variant is not supported in earlier versions.
love.keyboard.setKeyRepeat( enable )
boolean enableNothing.
The interval between repeats depends on the user's system settings. This function doesn't affect whether love.textinput is called multiple times while a key is held down.
Removed in LÖVE 0.9.0
This variant is not supported in that and later versions.
Enables key repeating and sets the delay and interval.
love.keyboard.setKeyRepeat( delay, interval )
number delaynumber intervalNothing.
Hold left or right to change the position.
function love.load()
love.keyboard.setKeyRepeat(true)
x = 50
end
function love.keypressed(key, isrepeat)
if key == "right" then
x = (x + 80) % love.graphics.getWidth()
elseif key == "left" then
x = (x - 80) % love.graphics.getWidth()
end
end
function love.draw()
love.graphics.circle("fill", x, 100)
end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.keyboard.setKeyRepeat