system.hasEventSource()

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

Overview

Returns 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 'Event Sources' below).

Event sources

Valid values of event sources include:

Example

local has_gyroscrope = system.hasEventSource( "gyroscope" )

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