lovr.event
EditThe 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.clear | Clear the event queue. |
lovr.event.poll | Iterate over unprocessed events in the queue. |
lovr.event.push | Manually push an event onto the queue. |
lovr.event.quit | Quit the application. |
lovr.event.restart | Restart 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