Sdl peepEvents
Tangent 128 edited this page Mar 28, 2015
·
3 revisions
Use this function to check the event queue for messages and optionally return them.
function SDL.peepEvents(count, action [, min [, max]])
- count, how many events to check
- action, the action to execute (see SDL.eventAction)
- min, optional, the minimum event (see SDL.event)
- max, optional, the minimum event (see SDL.event)
- a sequence table with all matched events
--
-- This will get all events without removing it from the queue only if they
-- match the mouse events.
--
local events = SDL.peepEvents(16, SDL.eventAction.Peek, SDL.event.MouseMotion, SDL.event.MouseWheel)
for _, e in ipairs(events) do
print(tostring(e.type))
end