love.event.push

love.event.push

Adds an event to the event queue.

Function

Synopsis

1
love.event.push( e, a, b, c, d )

Arguments

Event e
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.

Returns

Nothing.

Examples

Quitting a game in 0.8.0

1
2
3
4
5
function love.keypressed(k)
    if k == 'escape' then
        love.event.push('quit') -- Quit the game.
    end
end

Quitting a game in 0.7.2

1
2
3
4
5
function love.keypressed(k)
    if k == 'escape' then
        love.event.push('q') -- Quit the game.
    end
end

See Also


doc_love
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.