roomy
roomy copied to clipboard
Hooking onto keypressed does not trigger the callback.
While testing roomy on love 11.0.0, the keypressed callback does not work, but the keyreleased callback does.
code example?
stateManager = roomy.new()
function love.update(dt)
timer = timer+dt
FPS = 1/tick.dt
end
function love.draw()
end
stateManager:hook{callbacks = {"update", "draw", "quit", "keypressed", "keyreleased"}, applyBefore = {"draw"}}
requireDirectory("states") --essentially requires game.lua
stateManager:switch(game)
stateManager:apply()
game.loaded = true
in game.lua
game = {}
game.name = "game"
game.loaded = false
function game:keypressed(key)
print(key)
end
function game:keyreleased(key)
print(key)
end
It's a little hard to tell what's wrong without seeing the whole code. When do you switch to the game state?
It's a little hard to tell what's wrong without seeing the whole code. When do you switch to the game state?
Edited the original comment.
still don't see anything that looks wrong. if you post a love file i could take a look