lovr.headset.getAxis

Get the current state of an analog axis on a device. Some axes are multidimensional, for example a 2D touchpad or thumbstick with x/y axes. For multidimensional axes, this function will return multiple values, one number for each axis. In these cases, it can be useful to use the select function built in to Lua to select a particular axis component.

... = lovr.headset.getAxis(device, axis)

Arguments

NameTypeDescription
deviceDeviceThe device.
axisDeviceAxisThe axis.

Returns

NameTypeDescription
...numberThe current state of the components of the axis, or nil if the device does not have any information about the axis.

Notes

The axis values will be between 0 and 1 for 1D axes, and between -1 and 1 for multidimensional axes.

See also