axis

Type Event
Dispatch chain Runtime
Revision 2017.3060
Keywords axis

Overview

Axis events occur when analog data has been received from an InputDevice axis inputs. For example, axis events will be raised when a joystick has been moved, a gamepad's analog triggers have been pressed or released, a mouse has been moved, a scroll wheel has been moved, when movement has been detected on a touchpad/touchscreen, etc. This data is typically used by games which require analog controls.

Gotchas

Windows Phone does not currently support axis events.

Properties

Example

-- Called when an axis event has been received
local function onAxisEvent( event )
    print( event.axis.descriptor .. ": Normalized Value = " .. tostring(event.normalizedValue) )
end

-- Add the axis event listener
Runtime:addEventListener( "axis", onAxisEvent )