Available since LÖVE 0.6.0
This function is not supported in earlier versions.
Adds an event to the event queue.
See Variant for the list of supported types for the arguments.
From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six.
love.event.push( n, a, b, c, d, e, f, ... )
Event nVariant a (nil)Variant b (nil)Variant c (nil)Variant d (nil) Available since 0.8.0
Variant e (nil) Available since 0.10.0
Variant f (nil) Available since 0.10.0
Variant ... (nil) Available since 0.10.0
Nothing.
function love.keypressed(k)
if k == 'escape' then
love.event.push('quit') -- Quit the game.
end
end
function love.keypressed(k)
if k == 'escape' then
love.event.push('q') -- Quit the game.
end
end
© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.event.push