Type Function Object Runtime Library none Return value Boolean Revision 2017.3178 Keywords runtime, hasEventSource See also EventDispatcher:addEventListener()
Determines if the device is capable of providing events for a given event source such as
This function returns
true if the event source exists, meaning it is okay to call EventDispatcher:addEventListener() to handle its events.
false if the event source does not exist. For example, if this returns false for
"gyroscope" then this would indicate that the appropriate hardware was not found on the device.
Runtime:hasEventSource( eventSourceName )
String. The name of the event source for which to check existence. The following values are valid:
if Runtime:hasEventSource( "gyroscope" ) then Runtime:addEventListener( "gyroscope", myListener ) end