system.hasEventSource()

Type Function
Library system.*
Return value Boolean
Revision Release 2022.3683
Keywords system event

Overview

Returns a boolean true or false depending on whether the system delivers events corresponding to eventName.

Syntax

system.hasEventSource( eventName )
eventName (required)

String. The name of the event source that delivers events of that name — see the next section for details.

Event Sources

Valid values of event sources include:

Example

local hasGyroscrope = system.hasEventSource( "gyroscope" )

if hasGyroscrope then
    print( "The device has a gyroscrope." )
end