Difference between revisions of "Joystick:getID"

m (Updated link)
(Added second return value)
Line 4: Line 4:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
id = Joystick:getID( )
+
id, instance_id = Joystick:getID( )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
Line 10: Line 10:
 
=== Returns ===
 
=== Returns ===
 
{{param|number|id|The Joystick's unique identifier.}}
 
{{param|number|id|The Joystick's unique identifier.}}
 +
{{param|number|instance_id (nil)|Unique identifier which changes every time the Joystick is reconnected. nil if the Joystick is not connected.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::Joystick]]
 
* [[parent::Joystick]]
 +
* [[Joystick:isConnected]]
 
* [[Joystick:getProductGUID]]
 
* [[Joystick:getProductGUID]]
 
* [[Joystick:getConnectedIndex]]
 
* [[Joystick:getConnectedIndex]]

Revision as of 08:26, 28 August 2013

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Gets the joystick's unique identifier. The identifier will remain the same for the life of the game, even when the Joystick is disconnected and reconnected, but it will change when the game is re-launched.

Function

Synopsis

id, instance_id = Joystick:getID( )

Arguments

None.

Returns

number id
The Joystick's unique identifier.
number instance_id (nil)
Unique identifier which changes every time the Joystick is reconnected. nil if the Joystick is not connected.

See Also

Other Languages