Difference between revisions of "Joystick"
m |
m |
||
Line 47: | Line 47: | ||
* [[love.joystickaxis]] | * [[love.joystickaxis]] | ||
* [[love.joystickhat]] | * [[love.joystickhat]] | ||
+ | |||
* [[love.gamepadpressed]] | * [[love.gamepadpressed]] | ||
* [[love.gamepadreleased]] | * [[love.gamepadreleased]] |
Revision as of 04:16, 29 August 2013
Available since LÖVE 0.9.0 |
This type is not supported in earlier versions. |
Represents a physical joystick.
Constructors
love.joystick.getJoysticks | Gets a list of connected Joysticks. | 0.9.0 |
Functions
Joystick:getAxes | Gets the direction of each axis. | 0.9.0 | |
Joystick:getAxis | Gets the direction of an axis. | 0.9.0 | |
Joystick:getAxisCount | Gets the number of axes on the joystick. | 0.9.0 | |
Joystick:getButtonCount | Gets the number of buttons on the joystick. | 0.9.0 | |
Joystick:getDeviceInfo | Gets the OS-independent device info of the joystick. | 11.3 | |
Joystick:getGUID | Gets a stable GUID unique to the type of the physical joystick. | 0.9.0 | |
Joystick:getGamepadAxis | Gets the direction of a virtual gamepad axis. | 0.9.0 | |
Joystick:getGamepadMapping | Gets the button, axis or hat that a virtual gamepad input is bound to. | 0.9.0 | |
Joystick:getGamepadMappingString | Gets the full gamepad mapping string of this Joystick, or nil if it's not recognized as a gamepad. | 11.3 | |
Joystick:getGamepadType | Gets the GamepadType of the Joystick, if it's recognized as a gamepad. | 12.0 | |
Joystick:getHat | Gets the direction of a hat. | 0.9.0 | |
Joystick:getHatCount | Gets the number of hats on the joystick. | 0.9.0 | |
Joystick:getID | Gets the joystick's unique identifier. | 0.9.0 | |
Joystick:getJoystickType | Gets the JoystickType of the Joystick. | 12.0 | |
Joystick:getName | Gets the name of the joystick. | 0.9.0 | |
Joystick:getPlayerIndex | Gets the player index of this Joystick. This corresponds to an indicator light on many common gamepads. | 12.0 | |
Joystick:getSensorData | Gets the latest data for the given sensor type for this Joystick | 12.0 | |
Joystick:getVibration | Gets the current vibration motor strengths on a Joystick with rumble support. | 0.9.0 | |
Joystick:hasSensor | Gets whether the specified sensor exists in the Joystick. | 12.0 | |
Joystick:isConnected | Gets whether the Joystick is connected. | 0.9.0 | |
Joystick:isDown | Checks if a button on the Joystick is pressed. | 0.9.0 | |
Joystick:isGamepad | Gets whether the Joystick is recognized as a gamepad. | 0.9.0 | |
Joystick:isGamepadDown | Checks if a virtual gamepad button on the Joystick is pressed. | 0.9.0 | |
Joystick:isSensorEnabled | Gets whether the specified sensor is currently enabled on this Joystick. | 12.0 | |
Joystick:isVibrationSupported | Gets whether the Joystick supports vibration. | 0.9.0 | |
Joystick:setPlayerIndex | Sets the player index of this Joystick. This corresponds to an indicator light on many common gamepads. | 12.0 | |
Joystick:setSensorEnabled | Enables or disables the specified sensor on this Joystick. | 12.0 | |
Joystick:setVibration | Sets the vibration motor speeds on a Joystick with rumble support. | 0.9.0 | |
Object:release | Immediately destroys the object's Lua reference. | 11.0 | |
Object:type | Gets the type of the object as a string. | ||
Object:typeOf | Checks whether an object is of a certain type. |
Enums
GamepadAxis | Virtual gamepad axes. | 0.9.0 | |
GamepadButton | Virtual gamepad buttons. | 0.9.0 | |
GamepadType | Types of gamepad controllers. | 12.0 | |
JoystickHat | Joystick hat positions. | 0.5.0 | |
JoystickInputType | Types of Joystick inputs. | 0.9.0 | |
JoystickType | Types of Joysticks. | 12.0 |
Supertypes
See Also
- love.joystickadded
- love.joystickremoved
- love.joystickpressed
- love.joystickreleased
- love.joystickaxis
- love.joystickhat
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info