Removing key repeating
I think it might be good to remove
get/setKeyRepeat, because this functionality can be achieved using Lua.
It's useful for things like text box input, but there are heaps of other things like key repeat in games too: there's "joystick repeat" for using a menu or navigating a grid with a game controller, there's maybe even "mouse repeat" for holding down a scrollbar arrow, and there are cases where you want key repeat for some keys but not others, imagine a Tetris-style game where you want key repeat for moving the piece left and right, but not for rotating, and also you want the same controls for a game controller too. So I think key repeat should be handled just like the timing of anything else.
It's also got a kind of weird API, I think this is because of how SDL does it. I would expect the function to be
love.keyboard.setKeyRepeat( delay, interval ), where delay and interval could be any non-negative numbers, and calling it without arguments turns the key repeating off. However, the delay can't be 0, which seems like a reasonable value to have, and to turn the key repeating off you call the function with 0 as the delay.
And basically, I'm not sure it fits nicely into LÖVE. I think that things in LÖVE either:
- Do something you couldn't do otherwise.
- Do something which would be really slow otherwise.
- Are a simple and useful shortcut, like
love.graphics.getHeightis a shortcut for
select(2, love.graphics.getMode()), and
Canvas:renderTo(f)is a shortcut for
love.graphics.setCanvas(Canvas) f() love.graphics.setCanvas().
And I'm not sure if
setKeyRepeat falls into any of those categories.