Files
Basalt/docs/docs1_6/objects/Program/getQueuedEvents.md
Robert Jelic d4c72514ef Docs 1.6
Accidentally uploaded outdated 1.6 docs
2023-05-01 16:28:46 +02:00

1.1 KiB

getQueuedEvents

If the program is paused, incomming events will be inserted into a queued events table. As soon as the program is unpaused, the queued events table will be empty

Returns:

  1. table a table - {event="event", args={"a", "b",...}}

Usage:

  • prints the queued events table
local mainFrame = basalt.createFrame():show()
local aProgram = mainFrame:addProgram():execute("rom/programs/shell.lua"):show()
mainFrame:addButton():setText("inject"):onClick(function() basalt.debug(aProgram:getQueuedEvents()) end):show()

updateQueuedEvents

Here you can manipulate the queued events table

Parameters:

  1. table a table, items should be {event="event", args={para1, para2, para3, para4}}

Returns:

  1. object The object in use
local mainFrame = basalt.createFrame():show()
local aProgram = mainFrame:addProgram():execute("rom/programs/shell.lua"):show()

mainFrame:addButton():setText("inject"):onClick(function() 
local events = aProgram:getQueuedEvents()
table.insert(events,1,{event="char", args={"w"}}
aProgram:updateQueuedEvents(events) 
end):show()