Event documentation

Introductions

The 'event' API grants you full programmatic access to the running computer's event queues, as described in the System documentation page for events, the api to multiple different queues for events separated by category, and a special "all" queue that contains all events regardless of category.

The event api exists in the global space as "event" or "_G.event"

Categories?

each computer contains multiple categories, and every event is registered to one of them based off its relevance to the category. Below is a list of all categories

  • Unlabeled
  • User
  • System
  • Network
  • Peripheral
  • Compatibility
  • All

when a queue is retrieved by the API, all events that are returned are also removed from their home que, meaning that a event cant be read from the computer twice. its also relevant that each event is capped at 75 events capacity, and if needed old events will be forgotten to make room

The "All" category

The all category is unique to its neighboring categories, as all events regardless of category are also occupying All, it's not possible to queue events directly to all (doing so will instead categorize them as Unlabeled), however when a event is removed from the all que during reading it will also be removed from its assigned parent queue, and likewise events removed from traditional queues will have their clone removed from the all queue automatically, to uphold the rule that no event can be read twice.

Lookup table

getQueue(Category, filter = nil) Pulls every event eligible out of the queue
getFirst(Category, filter = nil) Pulls the first eligible item from the queue
clear() Clears all event queues

Functions in detail

getQueue(Category, filter = nil)

Pulls every event of the type specified by filter, or every event is no filter is provided

Because events are represented as lists, this function returns a list of lists that contain event data

Parameters: Category[String, non-case-specific], Filter[String] default value nil Returns: [[String, args...]...]

getFirst(Category, filter = nil)

Pulls the first event from the queue that fits the filter, or if there's no filter just the first event, and if there's no event that it returns nil

Parameters: Category[String, non-case-specific], Filter[String] default value nil Returns: [String, args...] or nil

clear()

Completely wipes every event queue

Parameters: None Returns: None