On this page
love.event.push
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.
Function
Synopsis
love.event.push( n, a, b, c, d, e, f, ... )
Arguments
-
Event n
- The name of the event.
-
Variant a (nil)
- First event argument.
-
Variant b (nil)
- Second event argument.
-
Variant c (nil)
- Third event argument.
Variant d (nil)
Available since 0.8.0- Fourth event argument.
Variant e (nil)
Available since 0.10.0- Fifth event argument.
Variant f (nil)
Available since 0.10.0- Sixth event argument.
Variant ... (nil)
Available since 0.10.0- Further event arguments may follow.
Returns
Nothing.
Examples
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
See Also
© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.event.push