lovr.event

The lovr.event module handles events from the operating system.

Due to its low-level nature, it's rare to use lovr.event in simple projects.

Functions

lovr.event.clearClear the event queue.
lovr.event.pollIterate over unprocessed events in the queue.
lovr.event.pumpPump new events into the queue for processing.
lovr.event.pushManually push an event onto the queue.
lovr.event.quitQuit the application.

Notes

You can define your own custom events by adding a function to the lovr.handlers table with a key of the name of the event you want to add. Then, push the event using lovr.event.push.

Example

Adding a custom event.

function lovr.load()
  lovr.handlers['customevent'] = function(a, b, c)
    print('custom event handled with args:', a, b, c)
  end

  lovr.event.push('customevent', 1, 2, 3)
end