remove a redundant loop
This commit is contained in:
parent
3c2185c9bf
commit
0c697d66e4
25
app.lua
25
app.lua
|
@ -7,19 +7,14 @@ function App.color(color)
|
|||
love.graphics.setColor(color.r, color.g, color.b, color.a)
|
||||
end
|
||||
|
||||
-- love.keyboard.isDown doesn't work on Android, so emulate it using
|
||||
-- keypressed and keyreleased events
|
||||
Keys_down = {}
|
||||
for name in pairs(love.handlers) do
|
||||
-- love.keyboard.isDown doesn't work on Android, so emulate it using
|
||||
-- keypressed and keyreleased events
|
||||
if name == 'keypressed' then
|
||||
love.handlers[name] = function(key, scancode, isrepeat)
|
||||
Keys_down[key] = true
|
||||
return love.keypressed(key, scancode, isrepeat)
|
||||
end
|
||||
elseif name == 'keyreleased' then
|
||||
love.handlers[name] = function(key, scancode)
|
||||
Keys_down[key] = nil
|
||||
return love.keyreleased(key, scancode)
|
||||
end
|
||||
end
|
||||
end
|
||||
love.handlers.keypressed = function(key, scancode, isrepeat)
|
||||
Keys_down[key] = true
|
||||
return love.keypressed(key, scancode, isrepeat)
|
||||
end
|
||||
love.handlers.keyreleased = function(key, scancode)
|
||||
Keys_down[key] = nil
|
||||
return love.keyreleased(key, scancode)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue