Skip to content
Tangent 128 edited this page Mar 28, 2015 · 3 revisions

SDL.pollEvent

Use this function to poll for currently pending events. This function is implemented as an iterator.

Function

SYNOPSIS

function SDL.pollEvent()

RETURNS

  • an iterator of event (see Event)

EXAMPLES

--
-- This is the recommended way of handling events
--
local running = true
while running do
for e in SDL.pollEvent() do
if e.type == SDL.event.Quit then
            running = false
end
end
end

SEE ALSO

SDL.waitEvent

Clone this wiki locally