Enables or disables key repeat for [[love.keypressed]]. It is disabled by default.
== Function ==
{{newin|[[0.9.0]]|090|type=variant}}
=== Synopsis ===
<source lang="lua">
love.keyboard.setKeyRepeat( enable )
</source>
=== Arguments ===
{{param|boolean|enable|Whether repeat keypress events should be enabled when a key is held down.}}
=== Returns ===
Nothing.
=== Notes ===
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.

== Function ==
{{oldin|[[0.9.0]]|090|type=variant}}
Enables key repeating and sets the delay and interval.
=== Synopsis ===
<source lang="lua">
love.keyboard.setKeyRepeat( delay, interval )
</source>
=== Arguments ===
{{param|number|delay|The amount of time before repeating the key (in seconds). 0 disables key repeat.}}
{{param|number|interval|The amount of time between repeats (in seconds)}}
=== Returns ===
Nothing.

== Examples ==
Hold left or right to change the position.
<source lang="lua">
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
</source>

== See Also ==
* [[parent::love.keyboard]]
* [[love.keyboard.hasKeyRepeat]]
* [[love.keypressed]]
[[Category:Functions]]
{{#set:Description=Enables or disables key repeat for [[love.keypressed]].}}
{{#set:Since=000}}
== Other Languages ==
{{i18n|love.keyboard.setKeyRepeat}}