Difference between revisions of "Joystick:isGamepad"
(Created page) |
(clarify "virtual gamepad" from other documentation) |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=function}} | {{newin|[[0.9.0]]|090|type=function}} | ||
− | Gets whether the Joystick is recognized as a gamepad. | + | Gets whether the Joystick is recognized as a gamepad. In LÖVE, a "gamepad" or "virtual gamepad" use names defined in [[GamepadAxis]] and [[GamepadButton]] instead of indexes so they are standardized across different operating systems and joystick models. Use gamepad-specific functions to query with these input names: [[Joystick:getGamepadAxis]], [[Joystick:isGamepadDown]], [[love.gamepadpressed]], etc. |
+ | |||
+ | LÖVE automatically recognizes most popular controllers with a similar layout to the Xbox 360 controller as gamepads, but you can add more with [[love.joystick.setGamepadMapping]]. | ||
+ | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === |
Latest revision as of 01:15, 31 December 2021
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Gets whether the Joystick is recognized as a gamepad. In LÖVE, a "gamepad" or "virtual gamepad" use names defined in GamepadAxis and GamepadButton instead of indexes so they are standardized across different operating systems and joystick models. Use gamepad-specific functions to query with these input names: Joystick:getGamepadAxis, Joystick:isGamepadDown, love.gamepadpressed, etc.
LÖVE automatically recognizes most popular controllers with a similar layout to the Xbox 360 controller as gamepads, but you can add more with love.joystick.setGamepadMapping.
Function
Synopsis
isgamepad = Joystick:isGamepad( )
Arguments
None.
Returns
boolean isgamepad
- True if the Joystick is recognized as a gamepad, false otherwise.
Notes
If the Joystick is recognized as a gamepad, the physical locations for the virtual gamepad axes and buttons correspond as closely as possible to the layout of a standard Xbox 360 controller.
See Also
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