Removes the listeners previously registered with the same type, callback, target and or useCapture, if only type is passed as parameter, all listeners registered with that type will be removed.
A string representing the event type being removed.
The callback to remove.
The target (this object) to invoke the callback, if it's not given, only callback without target will be removed
Register an callback of a specific system event type.
The event type
The event listener's callback
The event listener's target and callee
Sets whether to enable the accelerometer event listener or not.
Sets the accelerometer interval value.
Generated using TypeDoc
The System event, it currently supports keyboard events and accelerometer events.
You can get the
SystemEvent
instance withsystemEvent
.import { systemEvent, SystemEvent } from 'cc'; systemEvent.on(SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this); systemEvent.off(SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);