Joystick:getSensorData

Available since LÖVE 12.0
This callback is not supported in earlier versions.

Gets the latest data for the given sensor type for this Joystick.

The returned values have meaning based on the sensor type, for example an accelerometer will return acceleration values along each axis.


If the sensor was not enabled via Joystick:setSensorEnabled, this function may cause an error.

Function

Synopsis

x, y, z = Joystick:getSensorData( sensorType )

Arguments

SensorType sensorType
The type of sensor.

Returns

number x
The sensor's current 1st value.
number y
The sensor's current 2nd value.
number z
The sensor's current 3rd value.

See Also

Other Languages