Skip to content

Event

The Event library is used to pull events.

Usage

Lua
1
2
3
4
5
6
7
local event = require("event")

while true do
    local _, button, x, y = event.pull("mouse_down")

    print(string.format("You clicked at %s, %s with button %s", x, y, button))
end

Functions

pull

event.pull( [eventName1 [, eventName2, ...]] )

Wait for events.

Parameters

  1. ...eventName : string - Events to wait for.

Returns

  1. eventName : string - Name of the event.
  2. ...parameter : any - Any parameter related to the event pulled.

Throws

  • If interrupt event is emitted anytime despite the filter.

pullRaw

event.pullRaw( [eventName1 [, eventName2, ...]] )

Wait for events.

Note

interrupt event is emitted despite the filter, but will not error.

Parameters

  1. ...eventName : string - Events to wait for.

Returns

  1. eventName : string - Name of the event.
  2. ...parameter : any - Any parameter related to the event pulled.

push

event.push( eventName [, ...])

Push an event to the queue.

Parameters

  1. eventName : string - Name of the event.
  2. ...parameters : any? - Optional parameters.

Last update: March 11, 2023
Created: March 11, 2023