Type Function Library system.* Return value Boolean Revision 2017.3060 Keywords system event
Returns whether the system delivers events corresponding to eventName.
system.hasEventSource( eventName )
String. The name of the event source that delivers events of that name (See 'Event Sources' below).
Valid values of event sources include:
"accelerometer""gyroscope""heading""inputDeviceStatus""key""location""mouse""multitouch""orientation"
"collision""particleCollision""preCollision""postCollision"
local has_gyroscrope = system.hasEventSource( "gyroscope" )
if has_gyroscope then
print( "The device has a gyroscrope." )
end