Type Function Library system.* Return value Boolean Revision Release 2022.3683 Keywords system event
Returns a boolean true
or false
depending on 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 the next section for details.
Valid values of event sources include:
"accelerometer"
"gyroscope"
"heading"
"inputDeviceStatus"
"key"
"location"
"mouse"
"multitouch"
"orientation"
"collision"
"particleCollision"
"preCollision"
"postCollision"
local hasGyroscrope = system.hasEventSource( "gyroscope" ) if hasGyroscrope then print( "The device has a gyroscrope." ) end