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

SDL.peepEvents

Use this function to check the event queue for messages and optionally return them.

Function

SYNOPSIS

function SDL.peepEvents(count, action [, min [, max]])

ARGUMENTS

  • 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)

RETURNS

  • a sequence table with all matched events

EXAMPLES

--
-- 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
Clone this wiki locally