Type String Event system Revision 2017.3060 Keywords system, type
Identifies the type of system event that occurred. It will be one of the following values:
"applicationStart"
occurs when the application is launched and all code in main.lua
is executed."applicationExit"
occurs when the user or OS task manager quits the application."applicationSuspend"
occurs when the device needs to suspend the application, such as during a phone call or if the device goes to sleep from inactivity or user action. In the Simulator, this corresponds to selecting Suspend from the Hardware menu. During suspension, no events (not even "enterFrame"
events) are sent to the application while suspended, so if you have code that depends on time, you should account for the time lost to an application being suspended."applicationResume"
occurs when the application resumes after a suspend. On the device, this occurs if the application was suspended because of a phone call or sleep. In the Simulator, this corresponds to selecting Resume from the Hardware menu."applicationOpen"
occurs when the application is asked to open a URL or file, both of which are provided via the event.url property. For Win32 desktop apps configured to be When a user "force quits" an application, the "applicationExit"
event does not fire on any platform.
local function onSystemEvent( event ) print( "System event name and type: " .. event.name, event.type ) end Runtime:addEventListener( "system", onSystemEvent )