Type String Object InputAxis Revision 2017.3060 Keywords device, input, axis, type
A string describing the type of axis input that an InputDevice has, such as x
or y
for a joystick's
You should not rely on this property to identify the actual axis, since identifying the axis types of an input device is highly unreliable. It is common for an axis to misidentify itself, for example an axis identified as rotationZ
for the type
property — it's better to provide a key and axis binding screen to the user for mapping input controls, much like how it's done for desktop games.
Name | Description |
---|---|
unknown |
The type of axis input is unknown. |
x |
For a joystick or gamepad, this is the absolute For a touchscreen or mouse, this is the cursor's For a touchpad, this is the absolute |
y |
For a joystick or gamepad, this is the absolute For a touchscreen or mouse, this is the cursor's For a touchpad, this is the absolute |
z |
Represents the |
rotationX |
Indicates that the device provides rotation input around the |
rotationY |
Indicates that the device provides rotation input around the |
rotationZ |
Indicates that the device provides rotation input around the |
hatX |
The absolute |
hatY |
The absolute |
leftTrigger |
The left analog trigger on a gamepad. |
rightTrigger |
The right analog trigger on a gamepad. |
gas |
Indicates that the device provides "gas pedal" input. On Android, this will sometimes represent the right analog trigger on a gamepad. |
brake |
Indicates that the device provides "brake pedal" input. On Android, this will sometimes represent the left analog trigger on a gamepad. |
wheel |
Provides the absolute position of a steering wheel. |
rudder |
Absolute position of the rudder from a flightstick or pedals. |
throttle |
Absolute position of a throttle or slider device. |
whammyBar |
Absolute position of the whammy bar from a guitar. |
leftX |
The absolute |
leftY |
The absolute |
rightX |
The absolute |
rightY |
The absolute |
verticalScroll |
Provides relative vertical movements from a scroll wheel or scroll ball. |
horizontalScroll |
Provides relative horizontal movements from a scroll wheel or scroll ball. |
orientation |
Indicates the direction of a stylus or finger relative to a surface. |
hoverDistance |
Provides the distance that a finger or stylus is being held away from the touchscreen or touchpad. |
hoverMajor |
Provides the length of the major axis of the stylus or finger that is about to touch the touchscreen or touchpad. |
hoverMinor |
Provides the length of the minor axis of the stylus or finger that is about to touch the touchscreen or touchpad. |
touchSize |
Provides the surface area that is in contact with the touchscreen or touchpad. |
touchMajor |
Provides the length of the major axis of the stylus or finger that is in contact with the touchscreen or touchpad. |
touchMinor |
Provides the length of the minor axis of the stylus or finger that is in contact with the touchscreen or touchpad. |
pressure |
Provides the amount of pressure applied to the touchscreen or touchpad. Can be used by a mouse or trackball to indicate that a button was pressed. |
tilt |
Provides the angle that a stylus is being held, relative to the surface. |
generic1 |
Generic axis input 1. The data it provides is |
generic2 |
Generic axis input 2. The data it provides is |
generic3 |
Generic axis input 3. The data it provides is |
generic4 |
Generic axis input 4. The data it provides is |
generic5 |
Generic axis input 5. The data it provides is |
generic6 |
Generic axis input 6. The data it provides is |
generic7 |
Generic axis input 7. The data it provides is |
generic8 |
Generic axis input 8. The data it provides is |
generic9 |
Generic axis input 9. The data it provides is |
generic10 |
Generic axis input 10. The data it provides is |
generic11 |
Generic axis input 11. The data it provides is |
generic12 |
Generic axis input 12. The data it provides is |
generic13 |
Generic axis input 13. The data it provides is |
generic14 |
Generic axis input 14. The data it provides is |
generic15 |
Generic axis input 15. The data it provides is |
generic16 |
Generic axis input 16. The data it provides is |
-- Fetch all input devices currently connected to the system local inputDevices = system.getInputDevices() -- Traverse all input devices for deviceIndex = 1,#inputDevices do -- Fetch the input device's axes local inputAxes = inputDevices[deviceIndex]:getAxes() -- Print available axis type information for axisIndex = 1,#inputAxes do local inputAxis = inputAxes[axisIndex] print( inputAxis.descriptor .. ": " .. inputAxis.type ) end end