function love.draw()
for event, key in love.event.poll() do
if event == 'keypressed' then
love.graphics.print(key, 0, 0)
end
end
end
function love.keypressed(key, unicode)
love.event.push('keypressed', key)
end
The above causes love to freeze once a key is hit. any help?
You're not supposed to call event yourself. That's done for you in love.run() which is a function you can't see, but it's there, and it makes sure everything works.
Now, as to why it's freezing:
love.keypressed is executed in love.run's event loop, whenever the 'keypressed' event has been sent, your love.keypressed sends a new 'keypressed', so it keeps on handling these new events and therefore it creates in infinite loop.