event.isShake

Type Boolean
Event accelerometer
Revision Current Public Release (2018.3326)
Keywords accelerometer, isShake

Overview

When the user shakes the device, this value is true. What constitutes a shake is dependent on the OS/device.

Example

local function listener( event )
    if event.isShake then
        print( "The device is being shaken!" )
    end
     
    return true
end
 
Runtime:addEventListener( "accelerometer", listener )