system.hasEventSource()

Type Function
Library system.*
Return value Boolean
Revision Current Public Release (2017.3068)
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